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

how is george washington
Devise a 6-step synthesis of a carboxylic acid from ethyne using the reagents provided.
Which of the following shows the extraneous solution to the logarithmic equation below? log Subscript 3 Baseline (18 x cubed) minus log Subscript 3 Baseline (2
4 (x+2 )= 4. Slove for x
Determine the missing amounts in each of these four separate situations a through d. a b с d $ 2,816 625 $ 4.375 3,313 $ 11,264 11,864 Supplies available-prior
Solve the following systems of equations. 2x + y = 3 and y= -5x + 5
How would you correct the sentence fragment below? The ball just above the outfielder's head and into the road. Add "batter's" before "ball." Add "soared" afte
In a market economy economic activity is guided by.
A bag of marbles contains 4 red marbles and 4 green marbles.
I’m doing good political assignment and I have to explain what’s going on in the picture ( can y’all please help )