Question: C Programming Language #include int main() { int cases; int T; scanf(%d, &T); for(int q = 1; q { scanf(%d, &cases); printf(Case #%d: , T);
C Programming Language

#include
int main()
{
int cases;
int T;
scanf("%d", &T);
for(int q = 1; q
{
scanf("%d", &cases);
printf("Case #%d: ", T);
for(int i = cases; i>0; i--)
{
if(i == cases)
{
printf("%d SECONDS TILL NEW YEAR!! ", i);
}
else if(i == 60)
{
printf("%d SECONDS TILL NEW YEAR!! ", i);
}
else if(i == 30)
{
printf("%d SECONDS TILL NEW YEAR!! ", i);
}
else if(i == 10)
{
printf("%d SECONDS TILL NEW YEAR!! ", i);
}
else if(i == 5)
{
printf("%d SECONDS TILL NEW YEAR!! ", i);
}
else printf("%d ", i);
}
}
}
This is the code I have tried but the checking software has marked it incorrect. Are there any other methods or potential solutions?
New Year's Eve is still 2 months away, but as the one appointed to run the countdown, Bibi wants to finish the task as soon as possible. Bibi wants to make a program to count down from N to 1. To make it more interesting, she replaces some special numbers with "X SECONDS TILL NEW YEAR!!". The special numbers are 5, 10, 30, 60, and the starting number. Help Bibi to make the program. Format Input The first line will be an integer T, the number of test cases Each test case will contain an integer N, the starting number Format Output Print "Case #X:" on the first line of each test case. Then print the countdown each on their own line. Constraints 1N
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
