Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Multiple-choice Questions 1. Which data structure is defined as a collection of

ID: 3601333 • Letter: M

Question

Multiple-choice Questions 1. Which data structure is defined as a collection of similar data elements? (a) Arrays Trees (b) Structs (d Graphs urar reler to anode ind ibied Wnat tatement huanges ur o that irelesto the next node? (a) cursor; (b) cursor next (d) cursor cursor-next c) cursor s next; (a) int c) float (a) ptr.data 3 |The value 132.54 can represented using which data type? (b) char none 4 Which of the following is a valid variable name (b) char (c) grade (a) heap (c) cache memory (a) float id (d) %number 5 Where a memory located for local variable 6 7 what are the possible values of local variable of type char (b) stack none To declare an integer variable called "id" in C language we do the following (b) int ID d) none (c) char ItD (b) 'c (c) "troy A pointer variable can hold (a) string c) address (d) a and c answers 8 (b) integer (d) b and c answers (b) stack (d) a and b answers (b) stack (d) data (b) compile time 9 A pointer variable can point to the (a) heap (c) cache memory 101 where does C program locate memory for data storage (a) heap (e) a and b answers when does a memory located for local variable 11 (a) run time 12 The output of the code below is (c) link time (d) none int xe 4; printf"hello" f (x 5) else printf("no") (aj hello c) hellono (b) no d hihellono

Explanation / Answer

Answer 1. option(a) : Array.

Answer 2. Option(d) : cursor=cursor->next.

Answer 3. Option(c) : float.

Answer 4. Option(c): _grade.

Answer 5. Option(b): stack.

Answer 6. Option(d): none .

Answer 7. Option(b) : 'c'.

Answer 8. Option(c): address.

Answer 9. Option( d): pointers point to any memory where an object or function can appear: stack, static, heap, code, mapped, shared, whatever.

Answer 10. Option(c): it can be both stack and heap.

Answer 11. Option(a) : runtime .

Answer 12. Option(b) : no.

Answer 13. Option( d): infinite loop because when in while loop i is increasing and j are decreasing constantly.

Answer 14. Option(a): loop loop loop because loop will execute 3 times.

Answer 15. Option(d): print nothing because i has initial value 0 and in while statement i++ which is postfix so it will not enter into the loop.

Answer 16. Option(d) : Structure.

Answer 17. Option(b) : for loop .

Answer 18. Option(b): 3name because at an initil place we cant write a number.

Answer 19. Option(c): float because it is datatype and reserved.