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
Physics,
3 months ago
Chemistry,
3 months ago
World Languages,
3 months ago
Social Sciences,
6 months ago
CBSE BOARD X,
6 months ago
Math,
10 months ago
Math,
10 months ago