Back To C User Defined Functions Index
//program to create a function that returns largest of three numbers passed to it as arguments #include
#include
int findlarge(int,int,int); int findlarge(int a,int b,int c) { int max; max=a; if(b>max) { max=b; } if(c>max) { max=c; } return max; } void main() { int a,b,c; int large; clrscr(); printf("enter value for a"); scanf("%d",&a); printf("enter value for b"); scanf("%d",&b); printf("enter value for c"); scanf("%d",&c); large=findlarge(a,b,c); printf("largest of three numbers is %d",large); getch(); }