/*convert day into year,month,week & days*/
#include<stdio.h> #include<conio.h> void main() { int a,year,month,ry,rm,week,rw,days; clrscr(); printf("enter day\n"); scanf("%d",&a); year=a/365; ry=a%365; month=ry/30; rm=ry%30; week=rm/7; rw=rm%7; days=rw; printf("year=%d",year); printf("\nmonth=%d",month); printf("\nweek=%d",week); printf("\ndays=%d",days); getch(); }
No comments:
Post a Comment