What will be the output of the following pseudocode for p=3,9=4?
1.int fun1(int p,int q)
2. if (q EQUALS O)
3. return 0
4.if (q mod 2 EQUALS O)
5. return fun1(p+p, q/2)
6.return fun1(p+p, q/2)+p
Answers
Answered by
3
the answer is 12 for this recursive program
Similar questions