Why Arrays Are Needed
📖 Scenario: Imagine you want to store the scores of 5 students in a class. Instead of creating 5 separate variables, you can use an array to keep all scores together in one place.
🎯 Goal: You will create an array to store 5 student scores, set a passing score threshold, find which students passed, and print their scores.
📋 What You'll Learn
Create an integer array called
scores with exactly 5 elements: 58, 75, 62, 90, 45Create an integer variable called
passing_score and set it to 60Use a
for loop with variable i to check each score in scores against passing_scorePrint the scores of students who passed using
printf💡 Why This Matters
🌍 Real World
Arrays are used in real life to store lists of things like scores, temperatures, or names all together.
💼 Career
Knowing arrays is important for programming jobs because they help manage and process collections of data efficiently.
Progress0 / 4 steps