Question: in c language Write a program that uses repetition and switch statements to print the seven days of the week: Declare DAY = 1 Declare

in c language

Write a program that uses repetition and switch statements to print the seven days of the week:

  1. Declare DAY = 1
  2. Declare CHOICE = 1
  3. do {
    1. Use a switch statement to print the name of the day corresponding to the value of DAY
    2. Increase DAY by 1
    3. Ask the user to enter 1 if they want to keep seeing the days, or 0 if they want to stop.
    4. Take the user's input and store it in CHOICE
    5. If CHOICE is any value that isn't 0 or 1, the program should enter a loop to keep asking the user until they enter a valid value.
    6. If CHOICE is 0, use a break statement to exit the loop.
    7. If CHOICE is 1, use a continue statement to go back to the beginning of the loop.
  4. } while DAY < 8

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!