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

Read the excerpt from "The Most Dangerous Game,” by Richard Connell. "Rainsford," called the general, "if you are within sound of my voice, as I suppose you ar
PLZ HELP HURRY ASAP WILL GIVE BRAINLIEST AND 50 POINTS IF ANSWER RIGHT he figure is 1/4 of a circle. Quarter circle with horizontal radius and vertical radius
What was one cause of the Mexican Revolution in 1910? A. the U.S. desire for more Mexican land B. the Catholic church’s desire for a national religion
What is the answer please help
In the food pyramid the greatest biomass appears at the level of
Why did the states of Italy become leading centers of culture during the Renaissance?
Help plz 15 points!!!!!!!!!!!!!!!! really inportant
Which example is the weakest research question? A. What are the possible consequences of prolonged space travel? B. Why should the government continue to fund s
Please help not sure about this one
Third derivative of xsinx?