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

Species adapt over time through structural and behavioral adaptations. Which example describes a behavioral adaptation of a lion? A. sharp teeth for eating B.
What are the different reasons why people supported abolition
Force you apply to a simple machine is?
Liam worked 5 hours 30minutes on Monday and 4 hours 45 minutes on Wednesday.How many total hours did Liam work on Monday and Wednesday?!?
How Successful Were Stone Keeps In Defending Those Inside?
Who was the father of Haiku? A. Basho B. Okura C. Hay-On D. Koizumi
what is the answer to this -4(m + 6) = -8
Identify the function of the infinitive phrase. To win a marathon is my goal. subject, object of the verb, object of the preposition, subject complement
Hannah ran 200 yards during recess. Juanita ran 340 yards during recess. in feet, how much further did Juanita run than Hannah
How did the United States respond to Russia's invasion of Afghanistan?