Check out example codes for "c++ hours minutes seconds". It will help you in understanding the concepts better.

Code Example 1

int seconds, hours, minutes;
cin >> seconds;
minutes = seconds / 60;
hours = minutes / 60;
cout << seconds << " seconds is equivalent to " << int(hours) << " hours " << int(minutes%60) 
     << " minutes " << int(seconds%60) << " seconds.";

Learn ReactJs, React Native from akashmittal.com