home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sams Teach Yourself C in 21 Days (6th Edition)
/
STYC216E.ISO
/
mac
/
Examples
/
Day04
/
List0404.c
< prev
next >
Wrap
C/C++ Source or Header
|
2002-04-13
|
565b
|
29 lines
/* Demonstrates the use of if statement with else clause */
#include <stdio.h>
int x, y;
int main( void )
{
/* Input the two values to be tested */
printf("\nInput an integer value for x: ");
scanf("%d", &x);
printf("\nInput an integer value for y: ");
scanf("%d", &y);
/* Test values and print result */
if (x == y)
printf("x is equal to y\n");
else
if (x > y)
printf("x is greater than y\n");
else
printf("x is smaller than y\n");
return 0;
}