The ones who are crazy enough to think they can change the world are the ones who do.- Steve Jobs
An array which has only one subscript is known as one dimensional array i.e) int arr[10].
data_type varname[size];
In C programming, programmers can also initialize the array variable without mentioning the size of an array. The compiler will automatically deduct the size of an array.
int student[5] = {89, 76, 98, 91, 84};
int student[] = {89, 76, 98, 91, 84};
#include <stdio.h> int main() { int s[5] = {89, 76, 98, 91, 84}, i; printf("\n---Students marks details--- "); for(i = 0; i < 5; i++) { printf("\ns%d = %d ", i + 1, s[i]); } return 0; }
The above program illustrates that the declaration and initialization of one dimensional array. The first element of an array is s[0]. The last element of an array is a[4].
We may make mistakes(spelling, program bug, typing mistake and etc.), So we have this container to collect mistakes. We highly respect your findings.
© Copyright 2019