+ 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

8th Dec 2021, 1:08 AM
Chin Eu
Chin Eu - avatar
2 Respostas
+ 1
Got it, thanks Jay Matthews !
8th Dec 2021, 1:23 AM
Chin Eu
Chin Eu - avatar
0
#include <iostream> using namespace std; void min(int hour){ cin >> hour; cout << hour*60; } int main() { min(0); return 0; }
26th Aug 2022, 8:17 AM
the Monu
the Monu - avatar