C Language Program for Time Conversion

 

C Language Program for Time Conversion





/*******************************************************************
*Time conversion program in C Language
minute to seconds
seconds= minutes*60
* minutes to hour
hour= minutes/60

* hour to minutes
* minutes= hour*60

* Hour to seconds
seconds = 60*60*hour
***************************************************
*/

#include<stdio.h>
void main()
{
int seconds,minutes,hour,con;
printf("Please enter minutes to conversion in hours\n");
scanf("%d",&minutes);
printf("Enter hours to convert it into seconds\n");
scanf("%d",&hour);
con=minutes/60;
printf("The minutes to hours are:\t%d\n",con);
con=60*60*hour;
printf("The hours to seconds are:\t%d\n",con);
con=minutes*60;
printf("The conversion of minues to seconds is:\t%d\n",con);
con=minutes/60;
printf("The hours to minutes conversion is:\t%d",con);
}


Please enter minutes to conversion in hours

120

Enter hours to convert it into seconds

2

The minutes to hours are: 2

The hours to seconds are: 7200

The conversion of minues to seconds is: 7200

The hours to minutes conversion is: 2

टिप्पणी पोस्ट करा

0 टिप्पण्या