C program to Convert Hours into Minutes and Seconds

C program to Convert Hours into Minutes and Seconds 



CODE:-


#include<stdio.h>
#include<conio.h>
int main()
{
int x,y,z;
printf("ENTER TIME IN HOURS\n");
scanf("%d",&x);
z=x*60;
y=z*60;
printf("TOTAL MINUTES=%d\nTOTAL SECONDS=%d",z,y);
getch();
}
INPUT:-


TEST CASE 1:-

::-:: 4


OUTPUT:-



TOTAL MINUTES=240


TOTAL SECONDS=14400


TEST CASE 2:-



::-:: 9



OUTPUT:-



TOTAL MINUTES=540

TOTAL SECONDS=32400

In this program I declared three Variable (x,y,z), x for storing user input, z for storing time in minutes by multiplying x by 60, and y for storing seconds by multiplying z by 60, And then printed them on console screen using printf() function.

It`s Really very easy program to increase your interest in coding & make you comfortable comment down your question or if you want any other Code Comment it down We will provide you as soon as possible


Previous Post
Next Post
Related Posts

0 comments: