why array index always starts from zero??

Answers were Sorted based on User's Feedback



why array index always starts from zero??..

Answer / supercool

It uses the concept of Binary digits. Take an array size of 64 for example. We start from 0 and end at 63,
We require 6 bits.But, if we were to start from 1 and end at 64, we would require 7 bits to store the same number,
thus increasing the storage size.

Is This Answer Correct ?    3 Yes 0 No

why array index always starts from zero??..

Answer / guest

array's start from 0

Is This Answer Correct ?    6 Yes 7 No

why array index always starts from zero??..

Answer / 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

why array index always starts from zero??..

Answer / nobody special

because starting from 3 would just be silly?

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More C Interview Questions

Write a function to find the area of a triangle whose length of three sides is given

2 Answers  


what are two kinds of java

2 Answers  


#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }

1 Answers   Vector India,


please help me.. how to write a code of this output?? "Enter range number:"10 1 is an odd number 2 is an even numbers 3 in an odd numbers 4 " to 10" "printing all odd numbers:" 1,3,5,7,9 "printing all even numbers:" 2,4,6,8,10 "sum of all odd numbers:25 "sum of all even numbers:30 using a C Programming ARRAY pleas pleas help.. its my project ..please :(

1 Answers  


what does ‘segmentation violation’ mean?

1 Answers  






What do you mean by a sequential access file?

0 Answers  


how can i get the output 54321 4321 321 21 1 in c programming........???? pls help......

10 Answers   Infosys,


main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) { x=x+y; } y++; printf("The values of x and y are %d and %d."x,y); } What is the output?

5 Answers   TCS,


Can anyone help me with this please? Need to print the below values.. Thanks 1 1 2 1 2 3 1 2 3 4

3 Answers  


pick out the odd one out of the following a.malloc() b.calloc() c.free() d.realloc()

2 Answers   TCS, ZenQ,


There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.

15 Answers   Cisco, Google, MBT,


what is the difference between getch() and getche()?

7 Answers   Infosys,


Categories