Sunday, July 4, 2010

TIME CONVERSION

Buzz It
/*PROGRAM TO CONVERT TIME EXPRESSED IN
HOURS,MINUTES AND SECONDS TO SECONDS*/

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int h1,m1,s1,sec;
cout<<"enter the time in hour,min,sec\n";
cin>>h1>>m1>>s1;
sec=(h1*60*60)+(m1*60)+s1;
cout<<"the time in seconds is\n"<<sec;
getch();
}

OUTPUT:
enter the time in hour,min,sec
1 30 2
the time in seconds is
5402

0 comments:

Post a Comment