Solution
#include<stdio.h>
int main()
{
int month[]={31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},i,d,m,y;
char* day[]= {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
scanf("%d %d %d", &d, &m, &y);
if (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0))
month[1] = 29;
if (y < 1900 || m < 1 || m > 12 || d < 1 || d > month[m - 1]) {
// printf("This is an invalid date.\n");
return 1;
}
for (i = 1900; i < y; i++)
if (i % 4 == 0 && (i % 100 != 0 || i % 400 == 0))
d += 366;
else
d += 365;
for (i = 0; i < m - 1; i++)
d += month[i];
printf("%s\n", day[d % 7]);
return 0;
}
Good post!Thank you so much for sharing this pretty post,it was so good to read and useful to improve my knowledge as updated one,keep blogging.
ReplyDeletePython training in Electronic City
Wow… Nice Blog Thanks for Sharing This Useful Information.
ReplyDeleteLeading Advertising Agency in Hyderabad. Our Advertising agency delivers comprehensive Advertising & Branding solutions. We do Brand Identity, Planning, Logo Design, Packaging, In-store branding, Print Ads, Brochures, Digital Marketing, App design, UI,UX design and more.
Top Advertising Agency in Hyderabad
Top Branding Agency in Hyderabad
Best Branding Agency
Best Advertising Agency
Advertising Agency
Branding Agency
good thing you shared with us.keeping sharing articles like this.
ReplyDeleteFull Stack Training in Chennai | Certification | Online Training Course | Full Stack Training in Bangalore | Certification | Online Training Course | Full Stack Training in Hyderabad | Certification | Online Training Course | Full Stack Training in Pune | Certification | Online Training Course | Full Stack Training | Certification | Full Stack Online Training Course