Computer Science, asked by allarajanandini, 9 months ago

What will be the output of the following pseudocode for input 4?
1. Int sum(int num)
2. {
3. If(num is not equal to 0)
4. return num+num*sum(num-1)
5. Else
6. return num
7.}

Answers

Answered by sansanjeevi10
4

Answer:

64 is the answer.

Explanation:

1+1*0=1

2+2*1=4

3+3*4=15

4+4*15=64

Similar questions