C++ Write a program that asks for a number from the user and prints which day of
ID: 3915101 • Letter: C
Question
C++
Write a program that asks for a number from the user and prints which day of the week that number corresponds to. The days are indexed from 0 (Sunday) to 6 (Saturday). Store the names of the days in an array and print the name of the day in two ways:
with pointer arithmetic;
with array indexing.
Before the program gets a value from the array, it must first check if the given day is greater than or equal to zero and less than 7. If not, it should print the message: "Error, no such day." Your version of the program must print the same result as the expected output.
#include <stdio.h>
int main()
{
/* your code */
return 0;
}
Example input 5 Example output Pointer version: Friday Array index version: Friday