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

what two statements correctly describe the theory of tectonic plates
Anyone can find this?
When the Commissioner acts as a disciplinary authority, he must
A construction company uses the function f(x), where x is the number of people working on a project, to model the amount of money it spends to complete a projec
Which molecule is most polar? A) CH3CHO B)CO2 C)CH3Cl D)C2H6 E)NONE
The following data (in increasing order) for the attribute age: 13, 15, 16, 16, 19, 20, 20, 21, 22, 22, 25, 25, 25, 25, 30, 33, 33, 35, 35, 35, 35, 36, 40, 45,
Ali is AB blood type and Sarah is also AB blood type. What is the chance they will have a child with blood type A?
En una clase, 1/3 de los estudiantes eligieron estudiar español como segundo lenguaje vivo. 1/9 eligió italiano, el resto eligió alemán. Qué fracción de los est
Guys Help me please :( I:)) Give brainliest to those who help seriously Provide your reflection on the statement below. Mr. Greenspan did a very good job in ea
Write 42% as a fraction. There is no need to simplify your answer