Ask Question
11 January, 08:15

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

+4
Answers (1)
  1. 11 January, 11:33
    0
    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;
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “How do you get a code in C to count down from 5? ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers