Need program to output largest number of two. The main function must remain as is. I believe the getinput function is where the problem is. I can get program to run when I get the input from within the main function, but I can't get it to run with a separate getinput function (which unfortunately is how I am required to write it). Please help!! here is the program:
#include <iostream.h>
int getinput (int num1, int num2)
{
cout << "Enter two integers: ";
cin >> num1 >> num2;
return 0;
}
int getmax (int num1, int num2)
{
if (num1 > num2)
return num1;
else
return num2;
}
int main ()
{
int num1, num2;
getinput (num1, num2);
cout << "The bigger number is: " << getmax(num1, num2) <<endl;
return 0;
}