fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void hours(int hours);
  6.  
  7. int main()
  8.  
  9. {
  10.  
  11. int time;
  12.  
  13. cout << "Please enter the time in seconds \n " << endl;
  14. cin >> time;
  15.  
  16.  
  17. hours(int h, int s, int m);
  18. cout << "Hours: "<< h << endl ;
  19.  
  20. cout << "Minutes: " << m << endl;
  21.  
  22. cout << "Seconds: " << s << endl;
  23.  
  24. return 0;
  25.  
  26. }
  27.  
  28.  
  29. void hours(int time)
  30. {
  31. int h, s, m;
  32.  
  33. h = time/3600;
  34. s = time % 60;
  35. m = time%3600/60;
  36.  
  37. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:17: error: expected primary-expression before ‘int’
prog.cpp:17: error: expected primary-expression before ‘int’
prog.cpp:17: error: expected primary-expression before ‘int’
prog.cpp:18: error: ‘h’ was not declared in this scope
prog.cpp:20: error: ‘m’ was not declared in this scope
prog.cpp:22: error: ‘s’ was not declared in this scope
stdout
Standard output is empty