-
Notifications
You must be signed in to change notification settings - Fork 0
C_Arrays.c
SunilOS edited this page Sep 9, 2024
·
2 revisions
Explanation:
- #include <stdio.h>: This includes the standard I/O library needed for the printf function.
- int arr[3] = {1, 2, 3};: Declares an array of 3 integers and initializes it with values 1, 2, and 3.
- for (int i = 0; i < 3; i++): A loop that iterates through each element of the array.
- printf("arr[%d]: %d\n", i, arr[i]);: Prints the index and value of each element in the array.