+ 1

How to find day of any date in c++ prigramming?

can someone tell me, please....

25th Mar 2017, 7:01 AM
irshad ahmed
irshad ahmed - avatar
1 Odpowiedź
0
int dayname(int day, int month, int year) {     static int t[] = { 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 };     year -= month < 3;     return ( year + year/4 - year/100 + year/400 + t[month-1] + day) % 7; } //Sunday is 0, Monday is 1 ... /*http://stackoverflow.com/questions/6385190/correctness-of-sakamotos-algorithm-to-find-the-day-of-week/6385934#6385934*/
1st Apr 2017, 12:40 AM
Ciprian
Ciprian - avatar