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 are the 4 sub-components of the Cardio-respiratory system? Question 7 options: A. Heart, spleen, lungs and liver B. Heart, blood, spine and liver
First explain the advantages each side had at the start of the civil war. thene xplain why those advantages favored one side if the war were to go quickly and w
President kennedy decided to ask for civil rights legislation after the
PLZ HELP WITH ALGEBRA 1/3 (45- 18/7) Please put into simplest form
La madre del esposo de Alma es su _________. tía sobrina abuela suegra
If you had lived in india in 2500 b.c.e., where would you most likely have chosen to settle?
PLEASE HELP ME? I AM BEING TIMED ON THIS QUESTIONToday the cost of a gallon of gas is $2.65. Every week for the next 10 weeks, it will increase by $0.05 a gallo
The chart compares prospective voter support leading up to the 2012 presidential election. This chart demonstrates that more men were likely to be liberal voter
To the nearest hundredth, what is the value of x?
PLEASE TRANSLATE THIS TO ENGLISH! QUICK!