- 5 Given The Following Piece Of Code Include Stdio H Int Mystery Int A Int B If B 0 Return 1 Else If B 1 (66.16 KiB) Viewed 60 times
5. Given the following piece of code. #include = int mystery (int a, int b) { if (b 0) return 1; else if (b &
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
5. Given the following piece of code. #include = int mystery (int a, int b) { if (b 0) return 1; else if (b &
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]