How to count backwards (Print the numbers N, N - 1, ..., 0 (included)) in C

1 Answer

0 votes
#include <stdio.h>

int main() {
    int n = 5;
    
    for (int i = n; i >= 0; i--) {
	    printf("%d ", i);
    }

    return 0;
}



/*
run:

5 4 3 2 1 0 

*/

 



answered Jul 20, 2025 by avibootz
...