AthenAt1610 AthenAt1610
  • 11-07-2020
  • Computers and Technology
contestada

Write a statement that uses the decrement operator, in prefix mode, to decrease the value of the variable time.

Respuesta :

frknkrtrn
frknkrtrn frknkrtrn
  • 12-07-2020

Answer:

public class Main

{

public static void main(String[] args) {

    int time = 60;

    --time;

    System.out.println(time);

}

}

Explanation:

*The code is in Java.

Initialize an integer called time and set it to some value, in this case 60

To use the decrement operator in prefix mode, you need to write the decrement operator, --, before the variable time. The decrement operator decreases the variable value by one first and then gives back the new value. In our example the output will be 59.

Answer Link

Otras preguntas

Which sentence contains a nonrestrictive clause and is punctuated correctly? The teacher packed picnic lunches for all the students—which they loved—and ate l
Which social networking site became a gaming platform after 2009
I need help fast PLEASE!!!!!!
17. What's the sum of 6 feet 10 inches and 8 feet 9 inches? A. 14 ft. 7 in. B. 13 ft. 19 in. C. 15 ft. 7 in. D. 15 ft. 19 in.
Use the formula for a cylinder r=4 h=8 v?
which statemebt best conveys with the meaning of the text​
what is the circumference of the smaller circle​
what is the mass of oxygen in 10.0 grams of water
According to circus founder P. T. Barnum, what happens without publicity? Question 3 options: Business failure Decline in customers Increased productivity Nothi
What is the surface area of the right cone below? A. 176pi units^2 B. 896pi units^2 C. 224pi units^2 D. 167pi units^2