why array index always starts from zero??

Answer Posted / bijayalaxmi behera.

The index of an array is an OFFSET from the beginning of the
array, multiplied by the width of the array items:
Say an array of integers, 4 bytes long.
Say beginning of array at address 0x1000
First integer address: BaseAddress + (index * len) = 0x1000
+ ( 0 * 4) = 0x1000
Second integer will be at : 0x1000 + ( 1 * 4 ) = 0x1004.

Is This Answer Correct ?    4 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write program to remove duplicate in an array?

804


What are the types of i/o functions?

961


What is bin sh c?

775


What is static and volatile in c?

979


What is a pointer variable in c language?

833


Write a program to swap two numbers without using a temporary variable?

837


What is the use of a semicolon (;) at the end of every program statement?

1122


What language is lisp written in?

836


What is adt in c programming?

842


How many header files are in c?

739


What are the different types of linkage exist in c?

778


Where register variables are stored in c?

734


What is a char c?

790


Process by which one bit pattern in to another by bit wise operation is?

847


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

848