If tomorrow is saturday, today is friday.
A week has 7 days " Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday ".
40 / 7 = 5 ( Remainder = 5)
So you can say that after multiples of 7 days, the day will repeat itself as friday.
Hence after 35 days friday will occur again.
So we calculate after the remainder (5) , the answer is Wednesday.
Simple Logic = And whatever the remainder obtained is, add that to the day.