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

In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

0 Answers  


Differentiate between #include<...> and #include '...'

0 Answers  


How can draw a box in cprogram without using graphics.h header file & using only one printf(); ?

4 Answers   NIIT,


How to implement call back functions ?

3 Answers   HP,


Write a program for finding factorial of a number.

0 Answers   Tech Mahindra,


What is line in c preprocessor?

0 Answers  


When is an interface "good"?

1 Answers  


main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }

6 Answers  


What will be result of the following program? void myalloc(char *x, int n) { x= (char *)malloc(n*sizeof(char)); memset(x,\0,n*sizeof(char)); } main() { char *g="String"; myalloc(g,20); strcpy(g,"Oldstring"); printf("The string is %s",g); } a) The string is : String b) Run time error/Core dump c) The string is : Oldstring d) Syntax error during compilation e) None of these

3 Answers   IBM,


how to build a exercise findig min number of e heap with list imlemented?

0 Answers  


To what value do nonglobal variables default? 1) auto 2) register 3) static

4 Answers  


Write a program using bitwise operators to invert even bits of a given number.

2 Answers  


Categories