Lexysmith9217 Lexysmith9217
  • 21-10-2020
  • Computers and Technology
contestada

What is the output, if userVal is 5? int x; x = 100; if (userVal != 0) { int tmpVal; tmpVal = x / userVal; System.out.print(tmpVal); }

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 21-10-2020

Answer:

The output is 20

Explanation:

This line divides the value of x by userVal

tmpVal = x / userVal;

i.e.

tmpVal = 100/5

tmpVal = 20

This line then prints the value of tmpVal

System.out.print(tmpVal);

i.e 20

Hence, The output is 20

Answer Link

Otras preguntas

which set of numbers does 29 belong to?
Florida how many population
Which of the following is true about the tree 1 point
what was the church like before the french revolution?
3 tens+7 thousand+5 ten thosands+2ones +6 hundreds
what cannot be measured by SI units
help me solve this problem please
Lin sold 4 more shirts than Greg. Fran sold 3 times as many shirts as Lin. In total, the three sold 51 shirts. Which represents the number of shirts Greg sold?
What are the three types of nuclear radiation
(N^3 - N^4) - (3n^3- 7n^4)