Ask Question
25 December, 05:25

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

+2
Answers (1)
  1. 25 December, 08:18
    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?
Find an answer to your question ✅ “How do you get a code in C to count down from 5? ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers