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 geographic factor contributed to the formation of independent city-states in ancient Greece? 1. tropical rainforests 2. fertile farmland 3. navigable
Glenn needs to cut pieces of ribbon that are each 1 meter long to make ribbon keychains. If he has 3 pieces of ribbon that are each 1 decameter long, how man 1-
One pound of liquid water, frozen water (ice), and vaporized water (steam) are present under the same pressure. Which one would have the largest volume? A) ice
Why was the ruling in McCulloch v. Maryland significant?
explain why a chef in a very busy restaurant would prefer a copper pot an aluminum pot
What are odysseus consequences for taking down the cyclops?
The most basic level of Maslow's hierarchy of needs are __________ needs.
There are 20 green disks and 100 purple disks in a bag.what is the ratio of purple disks to green disks?
Which of the following is a compound sentence? A. Anywhere you want to go, we will follow. B. After the rain stopped, the girls decided to go to the pa
Help, please! Will award Brainliest! Classify each number as rational or irrational. 0.329 127.5 -89 √101