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 |
write a program to generate 1st n fibonacci prime number
Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1
how can we use static and extern?and where can we use this?
struct tag{ auto int x; static int y; };main() { struct tag s; s.x=4; s.y=5; printf(“%d”,s.x); }
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
Explain the meaning of keyword 'extern' in a function declaration.
Explain what math functions are available for integers? For floating point?
what are enumerations in C
second highest number in a given set of numbers
What does == mean in texting?
Is c still relevant?
Differentiate between functions getch() and getche().