Exercise 2 Write a program that will return the value in tod…