j

Tuesday, 3 November 2015

Write a program that take user age in days and then convert it into years, month, weeks, hours, minutes and seconds



#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int year,days,month,weeks;
long int hr,min,sec;
printf("Enter your age in days ::");
scanf("%d",&days;
year=days/365;
month=days/30;
weeks=days/7;
hr=days*24;
min=hr*60;
sec=min*60;
printf("Your age in year is %d\n",year);
printf("Your age in month is %d\n",month);
printf("Your age in weeks is %d\n",weeks);
printf("Your age in hours is %ld\n",hr);
printf("Your age in min is %ld\n",min);
printf("Your age in second is %ld",sec);
getch();
}

Subscribe to this Blog via Email :