Answer: Here's the code if you solve it using python
Step-by-step explanation:
day="Saturday"
date=int(input("Enter the day number: "))
if (date<=0) or (date>31):
print("Invalid day number")
else:
if date%7==1:
day="Saturday"
elif date%7==2:
day="Sunday"
elif date%7==3:
day="Monday"
elif date%7==4:
day="Tuesday"
elif date%7==5:
day="Wednesday"
elif date%7==6:
day="Thursday"
elif date%7==0:
day="Friday"
print(day)