Q1 Input no. of days and convert it
into no of years, months and days
remaining. *
Answers
Answered by
0
Explanation:
what? what do we have to tell in it
Answered by
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
Math,
4 months ago
Accountancy,
4 months ago
Social Sciences,
8 months ago
CBSE BOARD X,
8 months ago
Math,
1 year ago
Math,
1 year ago