100% struct time of start and end of observation of a chemical reaction
#include<stdio.h>
#include<conio.h>
struct timer
{
int hr,min,s;
}t1,t2;
void main()
{
clrscr();
printf("\n enter hours, minutes, seconds at which the observation of chemical reaction started: ");
scanf("%d%d%d",&t1.hr,&t1.min,&t1.s);
printf("\n enter hours, minutes, seconds at which the observation of chemical reaction concluded: ");
scanf("%d%d%d",&t2.hr,&t2.min,&t2.s);
printf("\n\n initial time=%2d:%2d:%2d",t1.hr,t1.min,t1.s);
printf("\n concluded time=%2d:%2d:%2d",t2.hr,t2.min,t2.s);
getch();
}
#include<conio.h>
struct timer
{
int hr,min,s;
}t1,t2;
void main()
{
clrscr();
printf("\n enter hours, minutes, seconds at which the observation of chemical reaction started: ");
scanf("%d%d%d",&t1.hr,&t1.min,&t1.s);
printf("\n enter hours, minutes, seconds at which the observation of chemical reaction concluded: ");
scanf("%d%d%d",&t2.hr,&t2.min,&t2.s);
printf("\n\n initial time=%2d:%2d:%2d",t1.hr,t1.min,t1.s);
printf("\n concluded time=%2d:%2d:%2d",t2.hr,t2.min,t2.s);
getch();
}
తెరమీద
enter hours, minutes, seconds at which the observation of chemical reaction started:11 12 15
enter hours, minutes, seconds at which the observation of chemical reaction concluded:11 13 21
the recorded data is:
initial time= 11:12:15
concluded time= 11:13:21
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.