Why array starts with index 0
Answers were Sorted based on User's Feedback
Answer / saurabh upman
Index is used as an offset value.Giving value 0 to the starting address means that we are 0 element far from the destination in a contigious memory arrangment.It makes the indexing a coherent offset to be assigned.
| Is This Answer Correct ? | 0 Yes | 0 No |
How pointer is different from array?
Is it valid to address one element beyond the end of an array?
In the following control structure which is faster? 1.Switch 2.If-else and which consumes more memory?
main() { static char *s[]={"black","white","yellow","voilet"}; char **ptr[]={s+3,s+2,s+1,s}, ***p; p=ptr; **++p; printf("%s",*--*++p+3); }
What does the characters “r” and “w” mean when writing programs that will make use of files?
What is %s and %d in c?
how to write optimum code to divide a 50 digit number with a 25 digit number??
An interactive c program to read basic salary of 15 persons. each person gets 25% of basic as HRA, 15%of basic as conveyance allowances, 10%of basic as entertainment allowances.The total salary is calculated by adding basic+HRA+CA+EA.Calculate how many out of 15 get salary above 10,000.Rs also print the salary of each employee
Does c have circular shift operators?
12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV
create an SINGLE LINKED LISTS and reverse the data in the lists completely
implement NAND gate logic in C code without using any bitwise operatior.