What will be the output of the following pseudocode when n = 3 ? Integer…
Infosys · 2024
What will be the output of the following pseudocode when n = 3 ?
Integer calc(Integer n)
if(n <= 0)
return 0;
if(n < 1)
return 1;
Print n
calc(n-1);
Print n
End function calc- A.
1 2 3
- B.
3 2 1 0
- C.
3 2 1 1 2 3
- D.
Compiler error
Attempted by 166 students.
Sign up free to check your answer
Sign up freeLoading lesson…