IHYPRESS PROGRAMMING
Tutorials and C programs with code and output for beginners
HOME
|
ASP
|
C
|
CSS
|
GNUPLOT
|
HTML
|
JAVASCRIPT
|
PERL
|
PHP
|
PYTHON
|
RUBY
|
SVG
C
❯
Loops
: Countdown Loop
<04.04>
/* Simple countdown using a for loop */
#include <stdio.h>
#define START 60
#define STOP 0
int main (void) {
int time;
/* the loop */
for (time=START; time>=STOP; time=time-1) { printf ("%d ", time); } printf ("\n\nLIFTOFF!\n\n"); return(0); }
60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 LIFTOFF!
COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland