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(); cout<<"enter value for a"; cin>>a; cout<<"enter value for b"; cin>>b; cout<<"enter value for c"; cin>>c; large=findlarge(a,b,c); cout<<"largest of three numbers is "<