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

two cars travel in opposite directions, starting from the same place at the same time. One travels at an average rate of 48 miles per hour and the other average
Compared to our sun the star Polaris is
Square root of x^2-4 plus x^2/x^2+1
what percent 591 is of 2364?
The phospholipid molecule has two parts, the polar end and the bipolar end. True or False?
Which equation has the same solution as 2x^2+x-3=0
What is cellulase made of?
explain why 4/10 and 40/100 have unlike denominators but are equivalent fractions.
the ratio of boys to girls on a swimming team is 3 to 4. the team has 70 members. how many are boys?
in a class of 24 students, 25 percent of them failed a test. How many students failed a test