+ 1
37.2 Practice - Hours To Minute
You are building an Hours to Minutes converter. Complete the given function so that it will take from user the count of hours as an argument, convert them into minutes, and output. Sample Input 5 Sample Output 300 My code: #include <iostream> using namespace std; //your function int toMinutes(int hours) { //complete the function return hours*60; } int main() { //call the function cout << toMinutes(5) << endl; return 0; } Not sure why it is not working
2 odpowiedzi
+ 1
Got it, thanks Jay Matthews !
0
#include <iostream>
using namespace std;
void min(int hour){
cin >> hour;
cout << hour*60;
}
int main() {
min(0);
return 0;
}