004-001-008
Array Declaration: Weekday List
Easy
Problem Description
array Declaration: Weekday List
In this problem, you will create a program that stores 3 weekdays in an array variable days, then displays each element with its index and the total element count to standard output.
Learning Objective: Declare array variables and store/access elements
Create a program to store and display weekdays in an array. Learn array declaration and initialization.
Input
None
Output
Weekdays:
days[0] = Monday
days[1] = Tuesday
days[2] = Wednesday
Total: 3 days
Specifications
- Declare array variable days
- Store 3 weekdays (Monday, Tuesday, Wednesday)
- Display each element with its index
- Display the array length
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up