5. Given the following piece of code. #include = int mystery (int a, int b) { if (b 0) return 1; else if (b &
Posted: Mon Mar 21, 2022 5:01 pm
5. Given the following piece of code. #include <stdio.h> = int mystery (int a, int b) { if (b 0) return 1; else if (b & 2 == 0) return mystery (ata, b/2); return mystery (a+a, b/2) + a; What will the execution of mystery(9,3) return? Give the trace of your execution. [5] 3 6. Given the following fragment of code int i = 8; switch(i) default: case 5: i += 3; if (i==11) i -=2; i *=2; break; case 7: i +=5; if (i = 8) i--; if (i =- 9) break; i *=3; } i -7; break; printf("i = $d\n", i); What will be the result of its execution? [3] Section B: Program Testing [25 marks]