22.4k views
9 votes
How do I double check to make sure I have the correct number for a variable?​

User Juhan
by
5.9k points

1 Answer

9 votes

Answer:

Use Print statement

Explanation:

The most common way to check this would be to use the print statement in whatever language you are using to have the value of that variable print to the screen/console. That way you know exactly what value your variable has stored within it at the moment that the print statement runs. Each language has a similar but different print statement like so...

Python: print(variable)

Java: System.out.println(variable);

User Petru
by
6.1k points