What I know about recursion is that it is that function calls itself and it has base condition where it stops. My professor wrote a program and he called that recursion is occurring in it and I said no, it's not. I am confused about it. So am asking you to clear my confusion. Program made by him is below in code:
int fact(int n) {
if (n == 0) {
return 1;
}
for (int i = n; i >= 1; i--) {
s1.push(i);
}
return Return_result();
}
int Return_result() {
int f = 1;
while (s1.top != -1) {
f = f * s1.pop();
}
return f;
}