Below is a program I have been working on and can\'t get to work, its fairly sim
ID: 3628621 • Letter: B
Question
Below is a program I have been working on and can't get to work, its fairly simple but I cant get it. I am writing a subprogram named biggest that receives three integer arguments and returns the largest number
#include
using namespace std;
int biggest (int, int, int);
int main()
{ int x,y,z,m;
cout << "enter 3 intergers"<cin >>x>>y>>z;
m=biggest(x, y, z);
cout<< "The biggest is" <return 0;
}
int biggest(int x, int y, int z);
if ((x>y)&&(x>z))
return x;
else if ((y>x)&&(y>z))
return y;
else if ((z>x)&&(z>y))
return z;
}
Explanation / Answer
#include
using namespace std;
int biggest (int, int, int);
int main()
{
int x,y,z,m;
cout << "enter 3 intergers";
cin >>x;
cin>>y;
cin>>z;
m=biggest(x, y, z);
cout<< "The biggest is" <return 0;
}
int biggest(int x, int y, int z)
{
if ((x>y)&&(x>z))
return x;
else if ((y>x)&&(y>z))
return y;
else if ((z>x)&&(z>y))
return z;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.