When I run this code, I have an exception like
Unhandled exception in 0x779C017E (ntdll.dll) in ConsoleApplication1.exe: 0x00000000: operation completed successfully.
If there is a handler for this exception, the program can safely continue.
How did I fix it? And thanks in advance.
#include<stdio.h>
int fn(int n) {
if (n == 1)
return 1;
return fn(n - 1) + fn(n - 2);
}
int main()
{
int n, k = 1;
scanf_s("%d",&n);
k = fn(n);
printf("%d", k);
return 1;
}
source
share