C program for no.Of days remaining in a year for the given date and month of a year
Answers
Answered by
0
C Program for finding the number of days remaining in a year.
#include <iostream.h>
#include <conio.h>
#include <iomanip.h>
void main()
{
int days, y, m, d;
clrscr();
cin>>"INPUT DATE AND MONTH OF THE YEAR";
scanf("%d", & ndays);
y = (int) ndays/365;
ndays = ndays-(365*y);
m = (int) ndays/30;
d = (int)ndays-(m*30);
cout<< "REMAINING DAYS"<<%d Year(s) \n %d Month(s) \n%d Day(s), "y, m, d"<<endl;
return 0;
getch();
}
SAMPLE RUN
INPUT DATE AND MONTH OF THE YEAR
27 9
REMAINING DAYS
96
Note :
- In the sample run entered input is 27th day of September (9) .
- And the output given is 96 days.
- Hence remaining days in the given sample run case is 96 days.
Similar questions