#include<iostream.h>
int functlargest(int, int, int);
int functsmallest();
int functdifference();
int main()
{
int num1, num2, num3;
cout<<"please enter 3 numbers: ";
cin>> num1 >> num2 >> num3;
functlargest(int);
functsmallest(int);
functdifference(int);
return 0;
}
functlargest(int a,int b, int c)
{
if (num1> num2 && num1>num3)
cout<<"The largest number is: "<<num1<<endl;
else if (num2>num1 && num2>num3)
cout<<"The largest number is: "<<num2<<endl;
else if (num3>num1 && num3>num2)
cout<<"The largest number is: "<<num3<<endl;
return largest;
}
functsmallest(num1,num2,num3)
{
if (num1<num2 && num1<num3)
cout<<"The smallest number is: "<<num1<<endl;
else if (num2<num1 && num2<num3)
cout<<"The smallest number is: "<<num2<<endl;
else if (num3<num1 && num3<num2)
cout<<"The smallest number is: "<<num3<<endl;
return smallest;
}
functdifference(int)
{
diff = largest - smallest;
cout<<"difference"<<diff;
return diff;
}
cutepoison 0 Newbie Poster
Salem 5,199 Posting Sage
Narue 5,707 Bad Cop Team Colleague
cutepoison 0 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.