home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tyc
/
list5_4.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-16
|
451b
|
26 lines
/* Demonstrates using multiple return statements in a function. */
#include <stdio.h>
int x, y, z;
int larger_of( int a, int b);
main()
{
puts("Enter two different integer values: ");
scanf("%d%d", &x, &y);
z = larger_of(x,y);
printf("\nThe larger value is %d.", z);
}
int larger_of( int a, int b)
{
if (a > b)
return a;
else
return b;
}