#include <stdio.h> #include <stdlib.h> /* Puzzle A05 -- print the integers from 15 down to 0, one per line */ int main(int argc, char *argv[]) { int j; for (j= 15; j >= 0; j-- ) { printf("%3d\n", j); } system("PAUSE"); return 0; }
No big problem here, but counting backwards is sometimes not as clear as counting forwards. Notice the ending condition of the loop.