why array index always starts from zero??
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / nobody special
because starting from 3 would just be silly?
| Is This Answer Correct ? | 1 Yes | 9 No |
Subtract Two Number Without Using Subtraction Operator
which one is better structure or union?(other than the space occupied )
What is the use of define in c?
Describe for loop and write a c program to sum the series X + x2/2! + x3 /3! + …….. up to fifteen terms.
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
main() { float a=3.2e40; printf("%d",a); }
Explain how can a program be made to print the name of a source file where an error occurs?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
what does ‘Bus Error’ mean?
What is null pointer in c?
what is answer for perfect number????????????????
Toggle nth bit in a given integer - num