Lecture 9 - Array in C Programming
Lecture 9 - Array in C Programming
Example:
int numbers[5]; // An array of 5 integers
Why Use Arrays?
Example:
int scores[3] = {90, 85, 70}; // Store 3 test scores
Declaring and Initializing Arrays
• Syntax: arrayName[index];
• Example:
int scores[5] = {90, 85, 70, 60, 50};
printf("%d", scores[0]); // Outputs 90 (first element)
Modifying Array Elements