Convert hours into minutes and seconds program in C++ (C Plus Plus).

Convert seconds into minutes and Hours program in C++ (C Plus Plus).

Convert hours into minutes and seconds program in C++ (C Plus Plus)

// Convert hours into minutes into second
#include <iostream>
using namespace std;
int main()
{
int h,m,s,sec;
cout<<"Enter Second ";
cin>>sec;
h=sec/3600;
sec=sec%3600;
m=sec/60;
sec=sec%60;
s=sec%60;
cout<<"Hours ="<<h<<endl;
cout<<"Mintes ="<<m<<endl;
cout<<"Second ="<<s<<endl;
}

Output:

Convert hours into minutes into second program in C++(C Plus Plus)

Figure:Convert hours into minutes into second program in C++ (C Plus Plus)

Prof.Fazal Rehman Shamil (Available for Professional Discussions)
1. Message on Facebook page for discussions,
2. Video lectures on Youtube
3. Email is only for Advertisement/business enquiries.