j

Tuesday, 3 November 2015

Write a program, that take two time and display the total time in hh:mm:ss format

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int h1,m1,s1,h2,m2,s2,hh,mm,ss,a;
cout<<"Enter 1st time hh:mm:ss format ::";
cin>>h1>>m1>>s1;
cout<<"Enter 2nd time hh:mm:ss format ::";
cin>>h2>>m2>>s2;
ss=s2+s1;
mm=m1+m2;
hh=h1+h2;
cout<<"Total time is "<<hh<<":"<<mm<<":"<<ss;
getch();
}


Subscribe to this Blog via Email :