Sunday, September 27, 2015

Prgoram to convert your age in months,weeks,days,hours,minutes, and seconds.

#include <stdio.h>
#include <conio.h>

 int main ( ) {
 int days,years,months,hours,minutes,seconds;
 float weeks;

 printf("Enter your age in years");
 scanf("%.1d",years);
 months=years*12;

printf("Age in months is %d\n",months);
weeks=years*52.14;

printf("Age in weeks is %.1f\n",weeks);
days=years*365;

printf("Age in days is %d\n",days);
 hours=days*24;

 printf("Age in hours is %d\n",hours);
 minutes=hours*60;

 printf("Age in minutes is %d\n",minutes);
 seconds=minutes*60;

 printf("Age in seconds is %d\n",seconds);  

getch();
return ();

}

No comments:

Post a Comment