0
#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;
}
3
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by Narue
0

Obviously in too much of a rush to be bothered with the simply courtesy of reading say this, or comprehending the watermark at the back of the edit window.

0

We'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.

0

here are the display message about the errors...i can't fix it...please help me...thanx....

from the program that i stated before,the error message is error in expression syntax in function main...

0

Here's a hint: This is how to declare, define, and call a function that returns a value:

#include <iostream>

int sum ( int a, int b, int c );

int main()
{
  int result = sum ( 1, 2, 3 );

  std::cout<< result <<'\n';
}

int sum ( int a, int b, int c )
{
  return a + b + c;
}

Compare this with your functions and see if you can figure out why yours are wrong.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.