Thành Nguyễn
New member
What will be the output of the following C function?
A. 1 2 3 4 5
B. 1 2 3 4
C. Compile time error
D. Stack overflow
Code:
#include <stdio.h>
int main()
{
reverse(1);
}
void reverse(int i)
{
if (i > 5)
exit(0);
printf("%d\n", i);
return reverse(i++);
}
B. 1 2 3 4
C. Compile time error
D. Stack overflow