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

Drug abuse is defined as __________.
What is the molar mass of magnesium nitride (Mg3N2) if the molar mass of magnesium is 24.31g and nitrogen is 14.01g?
The popular election of judges is supported mainly on the grounds that
True or false. Your computer should be password-protected
Mrs burger has graded 45 tests. This represents 60 percent of her 3 math classes. How many math students goes Mrs burger teach
The most important lifestyle choice you can make to improve physical fitness is __________.
What happened to Georgia in 1752?
Both Greta and Fred were on the bus that arrived in Pittsburgh. Fred was glad to be home. He looked forward to visiting with old friends. Greta, on the other ha
Find the grams of iron in 79.2 g of Fe2O3.
The table below gives information about the nucleus of each 4 atoms Atom Number of protons Number of neutrons A 6