Become a leader in the IoT community!
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
What will be the output of this program when num is 5?
#include <stdio.h>
int computeSum(int n) {
if (n == 0)
return 0;
else
return n + computeSum(n - 1);
}
int main() {
int num = 5;
int result = computeSum(num);
printf("Result: %dn", result);
return 0;
}
CONTRIBUTE TO THIS THREAD