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

a flywheel ( i = 55 kg m 2 ) starting from rest acquires an angular velocity of 208 rad/s while subject to a constant torque from a motor for 5 s. (a) What isth
Matias spent 6 hours studying for an exam, and he received an A on the exam. Normally, he would have spent that time watching TV instead of studying. Matias fig
Explique cómo el comienzo de la historia con el diálogo entre Rainsford y Whitney contribuye tanto a la caracterización de Rainsford por parte del autor como al
For what values of the variables much ABCD be a parallelogram?
Given: DO⟂ABC, DO =2√3, AB=BC=AC, m∠ADB=m∠BDC=m∠ADC=90 Find: The volume V
The Russian steppe was best suited to which of the following: A) Planting and harvesting various grains B) Trapping fur-bearing animals C) Cutting timber OD) Gr
T/F the firewall should go through vulnerability testing after each change
i NEED HELP ON THIS ASAP!!
the landlord is liable to people injured outside the property by defects that existed when the lease was signed. (true or false)
Descrive in words the rule that is used to determine the term value from its position in the sequence​