Multiple Choice (4 pts. each) For problems 21 through 35 use the following code
ID: 3602234 • Letter: M
Question
Multiple Choice (4 pts. each) For problems 21 through 35 use the following code for Use the following code and input for problems 30-31 your numeric answers A-0 B- C-2 D-3 E-4 AB-5 int numrows, numcols: AC-6 AD-7 AE -8 BC-9 BD -10 BE -11 CD-12 CE-13 DE 14 Use the following program for problems 21-22 int i,ji: int ourGrid[101 [10 scanf ("%d %d ", &numrows;, &numcols;); for (i=0; i«numrows; i++) { for (j=0;jcnum cols ; j++) { #include int mainO scanf ("%d", & (ourGrid [i] [j] ) ) ; int for n; (n n--) n); 15; n>=5; ", = Input: 237-813-54-6 11-1453 printf("%d, retur 0; 21. How many iterations of the loop occur? 22. What is the last value printed out? 30. How many values were stored in ourGrid? 31. What value is in position ourGrid[01[0]? Consider the following code snippet for problems 23 - 24 {1, Use the following code and input for problems 32-33 int myfunc (int mat [4] [4],int rows, int cols, int myarray [7] 2, 3, 4, 5, 6, 7); = int m) 23. The value 6 is at what index of the array? 24. The value at index 2 is? int int for k; sum=0; (k=0 ; kExplanation / Answer
21.ans- AC
22.ans - E
23.ans- AB(because array index starts from 0 by default)
24.ans- D
25.ans - C(in this code snippet if previous element is greater than next one then the elements are getting swapped.)
final array elemnts are in this order-3,4,2,5
26.ans- E
27.ans- D
28.ans- AB
29.ans- AB
30.ans- AC
31.ans- B
32.ans- D
33.ans- E
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.