#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
Recommended Answers
Jump to PostWe're not going to debug your program for you without any hints. If there's something wrong with it, tell us. Include any error messages you get and a detailed description of what you expect it to do. And read all of our announcements and rules before posting again, please.
All 4 Replies
Salem 5,265 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.