Data Structure Arrays Question:

Tell me do array subscripts always start with zero?

Tweet Share WhatsApp

Answer:

Yes. If you have an array a[MAX] (in which MAX is some value known at compile time), the first element is a[0], and the last element is a[MAX-1]. This arrangement is different from what you would find in some other languages. In some languages, such as some versions of BASIC, the elements would be a[1] through a[MAX], and in other languages, such as Pascal, you can have it either way.

Download Arrays PDF Read All 31 Arrays Questions
Previous QuestionNext Question
What will be output if you will execute following c code?
#include<stdio.h>
void main(){
long double a;
signed char b;
int arr[sizeof(!a+b)];
printf("%d",sizeof(arr))
}
Explain is it valid to address one element beyond the end of an array?