home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
98.img
/
LCNOW2.ZIP
/
EXAMPLES
/
MINIMUM.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-07-25
|
650b
|
34 lines
/*
* M I N I M U M
*
* This program determines the lesser of two
* numbers supplied by the user.
*/
main()
{
int lesser; /* the result */
int number1, number2; /* the input values */
/*
* Prompt the user for two numbers and read them.
*/
printf("Type the first number and press Enter: ");
scanf("%d", &number1);
printf("Type the second number and press Enter: ");
scanf("%d", &number2);
/*
* Find the lesser value and report it.
*/
if (number1 < number2)
lesser = number1;
else
lesser = number2;
printf("The lesser of %d and %d is %d.\n",
number1, number2, lesser);
return (0);
}