//Consider the following C program
#include <stdio.h>
int f(int *a,int *b,int c) {
if(c == 0) return 1;
else {
*b = *b-1;
*a = *a+1;
c = c - 1;
return *a + f(a,b,c) + *b;
}
}
int main() {
int a = 2,b = 2,c = 2;
printf("%d\n",f(&a,&b,c));
return 0;
}
Doubts :
- Is there any undefined behaviour according to C language?
- if NO, then what will be the output ?
- Please explain with proper explanation.