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

The circle below is centered at (3, 1) and has a radius of 2. What is its equation? O A. (x-3)2 + (y - 1)2 = 4 O B. (x-1)2 + (x-3)2 = 2 O c. (x - 1)2 + (y - 3)2
[tex] \frac{6x - 3}{2x + 7} = \frac{3x - 2}{x + 5} [/tex]solve for xurgent!!!!will give the brainliest!!​
How are women’s roles addressed in “A Rose for Emily”? What happens to women trapped in these traditional roles, as seen in this story?
The lowest common multiple of 48, 180 and m is 2160.Find the smallest possible value of m for which m is an even number.​
find the output, g, when the input, r, is 3. g = -5r + 13 g = __
Ways by which the moral standard can be minimised with in the Ghanaian youth
After reaching the summit, she descends 14 feet in 213 minutes. If she continues at this rate, where will Maggie be in relation to the summit after 8 minutes?
Why is acceleration due to gravity low in the space?
What were two outcomes of the treaty of Versailles
Faustus chooses to ignore which warnings? The good angel The writing on the wall The writing on his arm The writing on the chalice The burning page The congeale