Teaching UGC NET Mock Test Series 2025 (Paper 1 & 2) Programming and Data Structure Programming in C Function Recursion
Consider the function in C code:
void Cal(int a, int b) {
if (b != 1) {
if (a != 1) {
printf("*");
Cal(a / 2, b);
} else {
b = b - 1;
Cal(10, b);
}
}
}
How many times is going to be printed, if the function is called with Cal(10, 10); ?
1
25
2
23
3
24
4
27