+ 2
Help with codes
I try to make a program that calculates a given date whether that day is a Sunday, Monday or other day. putting the program lines here asks too much from this message post. I rather point to my codes and watch it there. My question: is there a way to make this better, other than over use the'if' function?
2 Answers
+ 4
its definitely possible.
+ 1
switch-case maybe or string array[7] from monday do sunday and modulo (%), like:
February 3,
sum= 31(january)+3=34,
day=sum%7,
cout << array[day].
34%7 is 6 so array[6] is sunday