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

1) 43x + 72 = 502;2 ) 19y - 200 = 47;​
The area of a rectangle is 2 square feet. The perimeter of the rectangle is 9 ft. Find the length, 1, and width, w, of the rectangle. What is 12 + W2?
what is the sum of 2 to the power of 3
Please help me with this homework
The area of a rectangle is 2 square feet. The perimeter of the rectangle is 9 ft. Find the length, 1, and width, w, of the rectangle. What is 12 + W2?
7x +2(-2x +1) how do I solve this? ​
does anyone know the answer? 2.9 + 9 /10
Draw a ray diagram in each case and state whether the image are real or virtual and also if they are upright or inverted a. U= 5 cm and f= 2 cm b. u = 10mm; f =
What does the song "No Church in the Wild" use from Plato's dialogue Euthyphro? What do you understand the song to be trying to say with that quote in this song
A rectangular room is 2 times as long as it is wide, and its perimeter is 34 meters. Find the dimension of the room. Length: meters Width: meters Round answ