Answer to Question #187613 in C for Angela Park

Question #187613

Using for loop, how to write a program that accepts a positive integer n, representing the number of seconds before the rocket will launch. The program should then output the numbers from n going down to 0. After the line containing the 0, the program should output another line with the words “Blast Off!”

1
Expert's answer
2021-04-30T16:50:46-0400
#include <stdio.h>

int main() {
    int n; 
    scanf("%d", &n);
    while (n >=0) {
        printf("%d\n", n);
        n--;
    }
    puts("Blast Off!");
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS