CHAPTER 18 / 26
C Arrays
Learn how arrays store multiple values of the same type.
01 — Syntax
data_type array_name[size];
02 — Example
#include <stdio.h>
int main() {
int marks[5] = {80, 75, 90, 88, 95};
for (int i = 0; i < 5; i++) {
printf("%d ", marks[i]);
}
return 0;
}03 — Important Points
- Array indexes start at 0.
- Do not access outside the array bounds.
04 — Common Mistakes
- Reading beyond the array.
- Using the wrong index.
05 — Real-World Use
Arrays are fundamental in data processing and low-level programming.
06 — Practice
Create a small program that demonstrates the main idea of C Arrays.