#include <stdio.h>
int
fibonacci (int n)
{
int ans;
if (n == 1 || n == 2)
ans = 1;
else
ans = fibonacci(n - 2) + fibonacci(n - 1);
return (ans);
}
int
main (void)
{
int a, result;
printf ("Enter an integer number: ");
scanf ("%d", &a);
/* calling the function */
result = fibonacci (a);
if (a == 1) printf ("The %dst fibonacci number is %d.\n", a, result);
if (a == 2) printf ("The %dnd fibonacci number is %d.\n", a, result);
if (a == 3) printf ("The %drd fibonacci number is %d.\n", a, result);
if (a > 3) printf ("The %dth fibonacci number is %d.\n", a, result);
return (0);
}