#include <iostream>
usingnamespace std;
int quotient(int numerator,int denomenator)
{
int answer;
answer = (numerator/denomenator);
return answer;
}
int main()
{
int numerator = 1;
int denomenator = 1;
int answer;
cout << "Enter numerator: ";
cin >> numerator;
cout << "Enter denomenator: ";
cin >> denomenator;
answer = quotient(numerator,denomenator);
cout << answer;
}
This is the correct way to return values. Although your quotient will *always* be an integer, because you specified it as such. (-1, 0, 1, 2, [...]) If you want to have it return a decimal value (1.5, 1.0251, ...) use type "double" instead of type "int" for all your values.