You are on page 1of 1

22. Write a C program to convert specified days into years, weeks and days.

Note: Ignore leap


year
#include <stdio.h>

#include <stdlib.h>

int main()

int week, day ,year,left;

printf ("enter the total number of days");

scanf("%d",&day);

year= day/365;

week=(day%365)/7;

left=(day-(year*365)-(week*7));

printf("%d days is equal to %d years%d weeks and %d days ",day,year,week,left);

return 0;

You might also like