Question: Write a program that displays the day of the week corresponding to a user-entered input number between 1 and 7 (for Sunday to Saturday). For

Write a program that displays the day of the week corresponding to a user-entered input number between 1 and 7 (for Sunday to Saturday). For example, in response to an input of 2, the program displays the name Monday.

a. Use %s as the format specifier in printf for displaying the day (eg. Monday).

2) Also, display the base address of the character string containing the displayed day.

a. Use %p as the format specifier in printf for displaying the address.

3) Also display the data pointed to by the pointer to the displayed day.

a. -Use %c as the format specifier in printf for displaying the data.

4) Use an array of pointers called *day[], as the data structure for the days of the week in this program. See slides 25,26 of lecture 10.

5) The output of your program should have this format:

a. "Day of the week is < Name of Day>

b. The base address of this string is ;

c. This address points to

6) Loop the program continually so new choices can be entered.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!