5. Given the following piece of code. #include = int mystery (int a, int b) { if (b 0) return 1; else if (b &
-
answerhappygod
- Site Admin
- Posts: 899604
- 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]
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!