Computer Science, asked by asmitabanerjee29, 10 months ago

write a program to input number of days and convert it into year, month,days

Answers

Answered by byaswanth2005
0

Answer:

Explanation:

could you mention which programming language i will try to answer

Answered by tiwarinikita0705
1

Answer:

Explanation:

#include <stdio.h>

#define DAYSINWEEK 7

void main()

{

int ndays, year, week, days;

printf("Enter the number of days\n");

scanf("%d", &ndays);

year = ndays / 365;

week =(ndays % 365) / DAYSINWEEK;

days =(ndays % 365) % DAYSINWEEK;

printf ("%d is equivalent to %d years, %d weeks and %d daysn",

ndays, year, week, days);

}

Similar questions