Wednesday 28 March 2012


TO CONVERT NUMBER OF DAYS INTO YEARS, WEEKS AND DAYS




TO convert a given number of days into to a measure of time given in years weeks and days
#include<stdio.h>
Void main();
{
Int temp,days,week, year,day;
Printf(“enter the number of days:”);
Scanf(“%d”,&days);
Temp=days;
Year=(int)days/365;
Days=days%10;
Week=(int)days/7;
Days=days%7;
Printf(“%d days equals %d year,%d week and %d days”,temp,year,week,day);
Getch();
}

No comments:

Post a Comment