Seudónimo Seudónimo
  • 13-11-2019
  • Computers and Technology
contestada

How do you get a code in C to count down from 5??

Respuesta :

abdch7634 abdch7634
  • 13-11-2019

Answer:

This is what the code should do:

“Lift off in T minus

5

4

3

2

1

Blast-off!”

When I run it, it just keeps printing ''Sum = 5'' forever.

Explanation:

Code:

int main(void) {

int sum = 5;  

int i;      

printf("Lift off in T minus\n");

for (i = 0; i < 5; i=i+i) {

   sum = sum - i;  

   printf("sum = %d\n",sum);  

}  

printf("Blast-off",sum);  

return 0;

Answer Link

Otras preguntas

What is the Hcf of 25 and 125
What is the Hcf of 25 and 125
For a chemical reaction it is usually found that the reaction rate is faster at higher temperature. The rate increases because (a) the concentrations of reacta
In an 8.00 km race, one runner runs at a steady 11.0 km/h and other runs at 14.8 km/h. How far from the finish line is the slower runner when the fast runner fi
rewrite without rational exponents, and simplify, if possible   (x²y²)1/7
What is the Hcf of 25 and 125
The sum of three consecutive odd numbers is 153 what is the smallest of the three numbers?
I need examples of cultural diffusion and why
Who discovered that the Earth took 365 days to move around the Sun?
what is 36/63 in simplest form?