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

in 1668 who conducted an experiment with meat and flies that disproved the idea of life arisingfrom non-livingmaterial
If x / y is an integer, which of the following statements must be true? A. both x and y are integers B. x is an integer C. either x or y is negative D. y / x
whent did industrial revolution happened?
1. In 1903 the Wright Brothers made the first successful powered flight by man at which location near Kitty Hawk?2. Sir Walter Raleigh sent several shiploads of
What is 23 squared and 62 squared please help?
Which statement best describes an igneous intrusion
Who was the first scientist to discover crystals?
How can you make 16 dollars using exactly and only 3 bills, one of which is not a 10-dollar bill?
How was donatello influenced by the beliefs and values of renaissance society?
What is the slope of any line parallel to the line 2x −3y = 7?