InstructionsTotal Questions: 20Total Minutes: 20This ExamTray Free Online Exam tests your C Programming Skills on C Arrays, Multidimensional Arrays and Pointers to Arrays. Examples are given as questions and answers. Easily Attend Competitive Exams and Job Interview Questions. Go through C Theory Notes on Arrays before attempting this test. All the Best Challenge SCORE0 / 20Take This Exam 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*Q Buttons 1) What is the output of C program with arrays and pointers.? int main() { int size=4; int a[size]; a[0]=5;a[1]=6; a[2]=7;a[3]=8; printf("%d %d", *(a+2), a[1]); } A) 8 6 B) 7 6 C) 6 6 D) Compiler error 2) What is the output of C program with arrays.? int main() { int ary(3)=[20,30,40]; printf("%d", a(1)); } A) 20 B) 30 C) 0 D) Compiler error 3) What is the output of C Program with arrays.? int main() { int rollno[3]=[1001,1002,1003]; printf("%d", rollno[1]); } A) 1002 B) 1003 C) address of 1002 D) Compiler error 4) What is the output of C program with arrays.? int main() { char grade={'A','B','C'}; printf("%c", grade[0]); } A) A B) B C) C D) Compiler error 5) What is the value of an array element which is not initialized.? A) By default Zero 0 B) 1 C) Depends on Storage Class D) None of the above. 6) What happens when you try to access an Array variable outside its Size.? A) Compiler error is thrown B) 0 value will be returned C) 1 value will be returned D) Some garbage value will be returned. 7) What is the size of an array in the below C program statement.? int main() { int ary[9]; return 0; } A) 8 B) 9 C) 10 D) None of the above Ad 8) What is the minimum and maximum Indexes of this below array.? int main() { int ary[9]; return 0; } A) -1, 8 B) 0, 8 C) 1,9 D) None of the above 9) Can we change the starting index of an array from 0 to 1 in any way.? A) Yes. Through pointers. B) Yes. Through Call by Value. C) Yes. Through Call by Reference. D) None of the above. 10) What is the need for C arrays.? A) You need not create so many separate variables and get confused while using. B) Using a single Array variable, you can access all elements of the array easily. C) Code maintainability is easy for programmers and maintainers. D) All the above. 11) What is the output of C program with arrays.? int main() { int ary[4], size=4; printf("%d ", ary[size]); return 0; } A) 0 B) 1 C) Random number D) Compiler error 12) What is the output of C Program with arrays.? int main() { int ary[4]; ary[4] = {1,2,3,4}; printf("%d ", ary[2]); return 0; } A) 2 B) 3 C) 0 D) Compiler error 13) What is the output of C Program with arrays.? int main() { int ary[3]={1,2}; printf("%d %d",ary[2]); return 0; } A) 0 B) 2 C) Garbage value D) Compiler error 14) What is a multidimensional array in C Language.? A) It is like a matrix or table with rows and columns B) It is an array of arrays C) To access 3rd tow 2nd element use ary[2][1] as the index starts from 0 row or column D) All the above. Ad 15) If an integer array pointer is incremented, how many bytes will be skipped to reach next element location.? A) 1 B) 2 C) 8 D) None of the above 16) What is the output of C Program with arrays and pointers.? int main() { int ary[] = {10,20,30}, *p; p = &ary[0]; int i=0; while(i<3) { printf("%d ", *p); p++; i++; } return 0; } A) 10 10 10 B) 10 20 20 C) 10 20 30 D) randomvalue randomvalue randomvalue 17) What is the function used to allocate memory to an array at run time with Zero initial value to each.? A) calloc() B) malloc() C) palloc() D) kalloc() 18) What is the function used to allocate memory to an array at run time without initializing array elements.? A) calloc() B) malloc() C) palloc() D) kalloc() 19) Choose a correct Syntax for malloc() function to allocate memory to an array at run time. A) int *p; p = (int*)malloc(10*sizeof(int)); B) int *p; p = (int*)malloc(10,sizeof(int)); C) int *p; p = (int*)malloc(sizeof(int), 10); D) int *p; p = (int*)malloc(10*sizeof(int *)); 20) What is the syntax of CALLOC to allocate memory to an array at runtime.? A) int *p; p = (int*)calloc(10, sizeof(int)); B) int *p; p = (int*)calloc(10*sizeof(int)); C) int *p; p = (int*)calloc(sizeof(int), 10); D) int *p; p = (int*)calloc(10, sizeof(int *)); FINISH EXAM 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*PREVPREV Arrays, Multidimensional Arrays and Pointers - Online Test 1 NEXTPREV Arrays, Multidimensional Arrays and Pointers - Online Test 3 Certification Group ID 3858