Something about my solution is off?


#1

main () {

for (int i = 99; i > 0; i-=3) {

printf(“Countdown %d\n”, i);

if ( i % 5 == 0 ) { printf (“GOTCHA!”); }

}

return 0;

}

My output looks fine, but i’m missing text “Countdown 0” after the text “Countdown 3”. Does this mean my assignment is incorrect/incomplete? Or is that how it’s spose’ to be?

**rectified by changing “>” to “>=”


#2

Your right, I kinda misunderstood your problem:

Correct code is

[code]#include <stdio.h>

main () {

for (int i = 99; i >= 0; i-=3) {
    
    printf("Countdown %d\n", i);
    
    if ( i % 5 == 0 ) { printf ("GOTCHA!"); }
    
}

return 0;

}[/code]