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

Whichof the following is not a correct scope when a JavaBean is usedwith JSP?applicationsessionrequestresponse
what is the answer to this question??
Which of these is the quadratic parent function? A. f(x) = |x| B. f(x) = x2 C. f(x) = x D. f(x) = 2x
Export subsidies are: A. maximum limits on the quantity or total value of specific products imported to a nation. B. excise taxes or duties placed on imported
The purpose of the general warm up is (A) to establish the optimal relationship between the forthcoming movements (B) return the body to its resting state (C)
After a group of gang members learned that their friend had died in a seemingly random accident, several of the friends started blaming a rival gang for the dea
What happens when a gas becomes ionized? A. Deposition Occurs B. Sublimation Occurs C. It becomes a liquid D. A plasma is formed
Which of the following rational functions is graphed below?
Factor completely x^2-3x-28
When did the worldwide response to ozone depletion begin? Select one: a. 1940s and 1950s b. 1960s and 1970s c. 1970s and 1980s d. 1980s and 1990s