Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

Students also viewed these Databases questions

Question

8. Explain the contact hypothesis.

Answered: 1 week ago

Question

7. Identify four antecedents that influence intercultural contact.

Answered: 1 week ago