[2-1]

#include<stdio.h>

main()

{

 double day,hour,min,sec;

 

 day=365.2422;

 hour=(day-(int)day)*24.0;

 min=(hour-(int)hour)*60.0;

 sec=(min-(int)min)*60.0;

 

 printf("%3d DAY %2d HOUR %2d MIN %4.1f SEC\n",(int)day,(int)hour,(int)min,sec);

}

 

[2-2]

#include<stdio.h>

main()

{

 float a,h,S;

 

 printf("Enter a h\n");

 scanf("%f %f",&a,&h);

 

 S=a*h*0.5;

 

 printf("a=%4.1f h=%4.1f\n",a,h);

 printf("Area=%5.1f\n",S);

}