Home > C Programming > Arrays > Questions and Answers
01. | What value does testarray[2][1][0] in the sample code below contain? | |||||||||||
|
02. |
What will be output when you will execute following C code? char *someFun1()
{ char temp[ ] = “string"; return temp; } main() { puts(someFun1()); } | |||||||||||
|
03. |
What will be output when you will execute following C code?
main()
{ register i=5; char j[]= "hello"; printf("%s %d",j,i); } | |||||||||||
|
04. |
What will be output when you will execute following C code? aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("bye"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); } | |||||||||||
|
05. |
What will be output when you will execute following C code? void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); } | |||||||||||
|
06. |
What will be the output of the following program if the base address of array is 100. main() { int gyan[] = { 1,2,3,4,5 }; int i,*ptr ; ptr = gyan; for(i = 0; i<=4 ; i++) { printf("\n %d", *ptr++); } } | |||||||||||
|
07. |
What will be output when you will execute following C code? #include { char arr[11]="The African Queen"; printf("%s", arr); return 0; } | |||||||||||
|
08. | Which of the following correctly declares an array? | |||||||||||
|
09. | What is the index number of the last element of an array with 29 elements? | |||||||||||
|
10. | Which of the following is a two-dimensional array? | |||||||||||
|