/***************************************************************
* File: iterative.c
* Purpose: Program to demonstrate the conditional
* (if .. else) statement
* Author: John Young
* Date: May 24, 2004
***************************************************************/
#include <stdio.h>
int main () {
int Entry;
int Counter;
printf ("Enter a positive integer: ");
scanf ("%d", &Entry);
Counter = 1;
while (Counter <= Entry) {
printf ("Iteration %d of %d\n", Counter, Entry);
Counter = Counter + 1;
}
return 0;
} |