home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Between Heaven & Hell 2
/
BetweenHeavenHell.cdr
/
100
/
90
/
ctutor2b.arc
/
IFELSE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1987-11-21
|
483b
|
20 lines
/* Chapter 3 - Program 4 */
/* This is an example of the if and the if-else statements */
main()
{
int data;
for(data = 0;data < 10;data = data + 1) {
if (data == 2)
printf("Data is now equal to %d\n",data);
if (data < 5)
printf("Data is now %d, which is less than 5\n",data);
else
printf("Data is now %d, which is greater than 4\n",data);
} /* end of for loop */
}