+ 1

any program to print day of a particular date ?????

18th Jul 2016, 9:15 AM
Kamal Singh
Kamal Singh - avatar
2 Réponses
+ 2
/* A program to find day of a given date */ #include<stdio.h> int dayofweek(int d, int m, int y) { static int t[] = { 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 }; y -= m < 3; return ( y + y/4 - y/100 + y/400 + t[m-1] + d) % 7; } /* Driver function to test above function */ int main() { int day = dayofweek(30, 8, 2010); printf ("%d", day); return 0; }
18th Jul 2016, 11:11 AM
Mahima Rajvir Singh
Mahima Rajvir Singh - avatar
0
Thank u
18th Jul 2016, 11:15 AM
Kamal Singh
Kamal Singh - avatar