InstructionsTotal Questions: 20Total Minutes: 20This ExamTray Free Online Exam or MCQ Quiz tests your C Programming Skills on C Structures and Pointers. Examples are given as questions and answers. Easily Attend Competitive Exams and Job Interview Questions. Go through C Theory Notes on Structures and Pointers 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 a structure in C language.? A) A structure is a collection of elements that can be of same data type. B) A structure is a collection of elements that can be of different data type. C) Elements of a structure are called members. D) All the above 2) What is the size of a C structure.? A) C structure is always 128 bytes. B) Size of C structure is the total bytes of all elements of structure. C) Size of C structure is the size of largest element. D) None of the above 3) What is the output of C program with structures.? int main() { structure hotel { int items; char name[10]; }a; strcpy(a.name, "TAJ"); a.items=10; printf("%s", a.name); return 0; } A) TAJ B) Empty string C) Compiler error D) None of the above 4) What is the output of C program.? int main() { struct book { int pages; char name[10]; }a; a.pages=10; strcpy(a.name,"Cbasics"); printf("%s=%d", a.name,a.pages); return 0; } A) empty string=10 B) C=basics C) Cbasics=10 D) Compiler error 5) Choose a correct statement about C structures. A) Structure elements can be initialized at the time of declaration. B) Structure members can not be initialized at the time of declaration C) Only integer members of structure can be initialized at the time of declaraion D) None of the above 6) Choose a correct statement about C structure.? int main() { struct ship { }; return 0; } A) It is wrong to define an empty structure B) Member variables can be added to a structure even after its first definition. C) There is no use of defining an empty structure D) None of the above 7) What is the output of C program.? int main() { struct ship { int size; char color[10]; }boat1, boat2; boat1.size=10; boat2 = boat1; printf("boat2=%d",boat2.size); return 0; } A) boat2=0 B) boat2=-1 C) boat2=10 D) Compiler error Ad 8) What is the output of C program with structures.? int main() { struct ship { char color[10]; }boat1, boat2; strcpy(boat1.color,"RED"); printf("%s ",boat1.color); boat2 = boat1; strcpy(boat2.color,"YELLOW"); printf("%s",boat1.color); return 0; } A) RED RED B) RED YELLOW C) YELLOW YELLOW D) Compiler error 9) What is the output of C program with structures.? int main() { struct tree { int h; } struct tree tree1; tree1.h=10; printf("Height=%d",tree1.h); return 0; } A) Height=0 B) Height=10 C) Height= D) Compiler error 10) Choose a correct statement about C structure elements.? A) Structure elements are stored on random free memory locations B) structure elements are stored in register memory locations C) structure elements are stored in contiguous memory locations D) None of the above. 11) A C Structure or User defined data type is also called.? A) Derived data type B) Secondary data type C) Aggregate data type D) All the above 12) What are the uses of C Structures.? A) structure is used to implement Linked Lists, Stack and Queue data structures B) Structures are used in Operating System functionality like Display and Input taking. C) Structure are used to exchange information with peripherals of PC D) All the above 13) What is the output of C program with structures.? int main() { struct tree { int h; int w; }; struct tree tree1={10}; printf("%d ",tree1.w); printf("%d",tree1.h); return 0; } A) 0 0 B) 10 0 C) 0 10 D) 10 10 14) What is the output of C program with structures.? int main() { struct tree { int h; int rate; }; struct tree tree1={0}; printf("%d ",tree1.rate); printf("%d",tree1.h); return 0; } A) 0 0 B) -1 -1 C) NULL NULL D) Compiler error Ad 15) What is the output of C program.? int main() { struct laptop { int cost; char brand[10]; }; struct laptop L1={5000,"ACER"}; struct laptop L2={6000,"IBM"}; printf("Name=%s",L1.brand); return 0; } A) ACER B) IBM C) Compiler error D) None of the above 16) What is the output of C program with structures pointers.? int main() { struct forest { int trees; int animals; }F1,*F2; F1.trees=1000; F1.animals=20; F2=&F1; printf("%d ",F2.animals); return 0; } A) 0 B) 20 C) Compiler error D) None of the above 17) What int main() { struct bus { int seats; }F1, *F2; F1.seats=20; F2=&F1; F2->seats=15; printf("%d ",F1.seats); return 0; } A) 15 B) 20 C) 0 D) Compiler error 18) What is the output of C program with structure arrays.? int main() { struct pens { int color; }p1[2]; struct pens p2[3]; p1[0].color=5; p1[1].color=9; printf("%d ",p1[0].color); printf("%d",p1[1].color); return 0; } A) 5 5 B) 5 9 C) 9 5 D) Compiler error 19) What is the output of C program with structure array pointers.? int main() { struct car { int km; }*p1[2]; struct car c1={1234}; p1[0]=&c1; printf("%d ",p1[0]->km); return 0; } A) 0 B) 1 C) 1234 D) Compiler error 20) Choose a correct statement about C structures. A) A structure can contain same structure type member. B) A structure size is limited by only physical memory of that PC. C) You can define an unlimited number of members inside a structure. D) All the above. FINISH EXAM 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*PREVStrings, Char Arrays, Pointers - Online Test 2 NEXTStructures and Pointers - Online Test 2 Certification Group ID 3864