C examples for Statement:for
Use the decrement operator to count down instead of up
#include <stdio.h> int main(void) { int secs;/* w ww. j av a2 s . co m*/ for (secs = 5; secs > 0; secs--) printf("%d seconds!\n", secs); printf("from book 2s.com!\n"); return 0; }