Professional Documents
Culture Documents
Assignment No: 04: Submitted To
Assignment No: 04: Submitted To
Submitted to :
Ma’am Shaista Rashid
Submitted by :
AZKA REHMAN 2657-FBAS/BSSE/F14
MARIUM KALSOOM 3400-FBAS/BSSE/F17
ANEESA NOSHEEN 3536-FBAS-BSCS-F17
SAMRA SEERAT 2753-FBAS-BSSE-F15
Submitted on :
29th april, 2021
Question#01:
SOLUTION:
MEMORY DIAGRAM:
5. For the function in question 4 find f(0).
SOLUTION:
MEMORY DIAGRAM:
6. For the function in question 4, suppose + is changed to * in the inductive
case. Find f(5).
SOLUTION:
MEMORY DIAGRAM:
7. For the function in question 4, what happens with the function
call f(-1)?
SOLUTION:
Question#02:
Assume ASCII representation of characters and the following function f().
Tell what output will be produced by the function call.
1) F(‘C’)
SOLUTION:
MEMORY DIAGRAM:
2) F(‘G’)
SOLUTION:
MEMORY DIAGRAM:
3) F(‘3’)
SOLUTION:
MEMORY DIAGRAM:
4) F(‘C’) if ch-1 is replaced by ch+1
SOLUTION:
MEMORY DIAGRAM:
5) F(‘C’) if the output and recursive call to f() are interchanged.
SOLUTION:
MEMORY DIAGRAM:
6) F(‘C’) if a copy of the output statement is inserted before
recursive call to f().
SOLUTION:
MEMORY DIAGRAM: