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

Suppose the inventory is unordered (!) and a sequential search is done to locate a specific artifact. Given that the search is executed on a computer that can d
A process to produce aluminum from aluminum oxide has an 85.0% yield. How much aluminum will be produced from a reaction 700.0 kg of aluminum oxide to produce A
On a separate sheet of paper please answer these 1. Was Lin Zexu a hero?
what is the answer to 1
Do you think that the volume control on an audio amplifier is calibrated in intensity or intensity level? In other words, if you turn your stereo half way down,
A mass weighing 32 pounds stretches a spring 2 feet. Determine the amplitude and period of motion if the mass is initially released from a point 1 foot above th
i could use some help plz​
How to solve 2 2/6 +4 3/6
Why we have leap year?
Can someone find the slope