One problem that stands out is you contracted to return a double from your function, yet you are not returning anything. You are printing out a garbage value.
Your compiler is not doing you any favors. It should either issue a warning, or in the case of Visual Studio the code you wrote will have a compile error.
Something like this should work:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
double GetMinutesAsHours(double origMinutes)
{
return origMinutes / 60.0;
}
int main()
{
std::cout << "Enter the # of minutes you want converted to hours: ";
double minutes;
std::cin >> minutes;
std::cout << GetMinutesAsHours(minutes) << " hours.\n";
}
Enter the # of minutes you want converted to hours: 75
1.25 hours.
Using code and output tags helps to make things much more readable.