I'm new to C++ and I am struggling with the whole separate function thing and I am so frustrated right now it's not even funny. What i'm supposed to do is this code and I ask for the 1st number and the 2nd number and then output the quotient and remainder. So I did the code and I fixed most of the errors and now I have 2 errors that say:
1>C:\Users\Rebe cca Vance\Documents \Visual Studio 2005\Projects\H W_3b\Debug\HW_3 b.exe : fatal error LNK1120: 1 unresolved externals
1>3b.obj : error LNK2019: unresolved external symbol "int __cdecl GetRemainder(vo id)" (?GetRemainder@ @YAHXZ) referenced in function _main
I don't know what these mean. Here is my code. Please someone help me!
# include <iostream>
using namespace std;
int GetNum1 ();
int GetNum2 ();
int GetQuotient ();
int GetRemainder ();
void PrintSum (int, int, int, int);
int main ()
{
int num1;
int num2;
int quotient;
int remainder;
num1=GetNum1 ();
num2=GetNum2 ();
quotient=GetQuo tient ();
remainder=GetRe mainder ();
return 0;
}
int GetNum1 ()
{
int num1;
cout << "Enter first number\n";
cin >> num1;
return num1;
}
int GetNum2 ()
{
int num2;
cout <<"Enter second number\n";
cin >> num2;
return num2;
}
int GetQuotient ()
{int num1;
int num2;
int quotient;
quotient=num1/num2;
return quotient;
}
int GetRemainer ()
{int num1;
int num2;
int remainder;
remainder=num1% num2;
return remainder;
}
void PrintSum ()
{int num1;
int num2;
int quotient;
int remainder;
cout << num1 << "divided by "<< num2<< " equals " << quotient << " with a remainder of "<<remainder<<" .\n";
}
1>C:\Users\Rebe cca Vance\Documents \Visual Studio 2005\Projects\H W_3b\Debug\HW_3 b.exe : fatal error LNK1120: 1 unresolved externals
1>3b.obj : error LNK2019: unresolved external symbol "int __cdecl GetRemainder(vo id)" (?GetRemainder@ @YAHXZ) referenced in function _main
I don't know what these mean. Here is my code. Please someone help me!
# include <iostream>
using namespace std;
int GetNum1 ();
int GetNum2 ();
int GetQuotient ();
int GetRemainder ();
void PrintSum (int, int, int, int);
int main ()
{
int num1;
int num2;
int quotient;
int remainder;
num1=GetNum1 ();
num2=GetNum2 ();
quotient=GetQuo tient ();
remainder=GetRe mainder ();
return 0;
}
int GetNum1 ()
{
int num1;
cout << "Enter first number\n";
cin >> num1;
return num1;
}
int GetNum2 ()
{
int num2;
cout <<"Enter second number\n";
cin >> num2;
return num2;
}
int GetQuotient ()
{int num1;
int num2;
int quotient;
quotient=num1/num2;
return quotient;
}
int GetRemainer ()
{int num1;
int num2;
int remainder;
remainder=num1% num2;
return remainder;
}
void PrintSum ()
{int num1;
int num2;
int quotient;
int remainder;
cout << num1 << "divided by "<< num2<< " equals " << quotient << " with a remainder of "<<remainder<<" .\n";
}
Comment