Aspire Faculty ID #17747 · Topic: JECA MCA 2025 · Just now
JECA MCA 2025

What will be the output of the following C program? 
#include int recur(int n) 
{ 
if(n == 0) 
return 0; 
else 
return n + recur(n - 1); } 
int main() 
{ 
int result = recur(4); 
printf("%d ", result); 
return 0; 
}

Solution

recur(4)=4+3+2+1=10.

Previous 10 Questions — JECA MCA 2025

Nearest first

Next 10 Questions — JECA MCA 2025

Ascending by ID
Ask Your Question or Put Your Review.

loading...