NBA - Boston Celtics

Saturday, 20 October 2012

GREATEST OF THREE NO. USING FUNCTION


#include<iostream.h>
int large(int a,int b,int c);
int a,b,c;
void main()
{
cout<<"enter three numbers\n";
cin>>a>>b>>c;
int ans;
ans=large(a,b,c);
}
int large(int a,int b,int c)
{
if(a>b&&a>c)
cout<<a<<" is greater";
else if(b>a&&b>c)
cout<<b<<" is greater";
else if(c>a&&c>b)
cout<<c<<" is greater";
}


No comments:

Post a Comment