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 to write it in polynomials in standard form y^2+3y^4-7y+2y^3-4
A gumball machine contains 100 gumballs of 5 different colors: 36 red, 15 blue, 24 orange, 12 green, and the rest are white. The machine dispenser randomly sele
What are the threeWhat are the three most common types of stages? most common types of stages?
In paragraph 22, the author says that our impulse has become to think, “I want to have a feeling; I need to send a text.” How do the independent clauses in this
Explain why the inner linings of the body are important to animals? 1 The inner linings allow water to enter the body. 2 The inner lining is the location where
The difference of a number and 7 is the same as 38. PLEASE ANSWER IN A WORD PROBLEM ASAPPPP
Any number divisible by 5 is divisible by 10 ?
Which of the following is NOT a subatomic particle of an atom? Neutron Nuclear wall Proton Electron
A. (-1,3) B. (3, -1) C. (-7, 3) D. (3, -7)
Jules is participating in the first round of a math competition. She competes in one contest a month in each of the first ten months of the school year. She can