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!”
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
while (n >=0) {
printf("%d\n", n);
n--;
}
puts("Blast Off!");
return 0;
}
Comments
Leave a comment