Simple C program for counting the number of years, weeks and days. If you have any doubts, let me know
#include<stdio.h> main() { int c,year,x,week,day; printf("enter no of days"); scanf("%d",&c); year=c/365; x=c%365; week=x/7; day=x%7; printf("YEAR %d",year); printf("WEEK %d",week); printf("DAY %d",day); }
#include<stdio.h> main() { int c,year,x,week,day; printf("enter no of days"); scanf("%d",&c); year=c/365; x=c%365; week=x/7; day=x%7; printf("YEAR %d",year); printf("WEEK %d",week); printf("DAY %d",day); }
No comments:
Post a Comment