Computer Science, asked by anchalishika, 8 months ago

Q1 Input no. of days and convert it
into no of years, months and days
remaining. *​

Answers

Answered by gokusiddharth
0

Explanation:

what? what do we have to tell in it

Answered by shoubhajit26
0

Answer:

int main() {

int ndays, y, m, d;

printf("Input no. of days: ");

scanf("%d", &ndays);

y = (int) ndays/365;

ndays = ndays-(365*y);

m = (int)ndays/30;

d = (int)ndays-(m*30);

printf(" %d Year(s) \n %d Month(s) \n %d Day(s)", y, m, d);

return 0;

}

Copy

Sample Output:

Input no. of days: 2535

6 Year(s)

11 Month(s)

15 Day(s)

Similar questions