fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. //int const seconds = ;
  6.  
  7. int hours(int time);
  8. int minutes(int time);
  9. int second(int time);
  10.  
  11.  
  12. int main()
  13.  
  14. {
  15. int seconds, h, m, s;
  16.  
  17. cout << "Please enter the time in seconds \n " << endl;
  18. cin >> seconds;
  19.  
  20.  
  21. int hours(int time);
  22. cout << "Hours: "<< h << endl ;
  23.  
  24. int minutes(int time);
  25.  
  26. cout << "Minutes: " << m << endl;
  27.  
  28. int seconds(int time);
  29.  
  30. cout << "Seconds: " << s << endl;
  31.  
  32. return 0;
  33.  
  34. }
  35.  
  36.  
  37. int hours(int time)
  38. {int h = seconds/3600;
  39. return h; }
  40.  
  41. int minutes(int time)
  42. { int m = seconds%3600/60;
  43. return m; }
  44.  
  45. int second(int time)
  46. { int s = seconds%60;
  47. return s; }
  48.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:28: error: ‘int seconds(int)’ redeclared as different kind of symbol
prog.cpp:15: error: previous declaration of ‘int seconds’
prog.cpp: In function ‘int hours(int)’:
prog.cpp:38: error: ‘seconds’ was not declared in this scope
prog.cpp: In function ‘int minutes(int)’:
prog.cpp:42: error: ‘seconds’ was not declared in this scope
prog.cpp: In function ‘int second(int)’:
prog.cpp:46: error: ‘seconds’ was not declared in this scope
stdout
Standard output is empty