error in ma program it shows the last digit twice.
#include<conio.h>
#include<stdio.h>
int main()
{
int fib(int);
int n,c,a=0,b=1;
printf("enter a number: ");
scanf("%d",&n);
printf("%d %d ",a,b);
c=fib(n);
printf("%d ",c);
getch();
}
int fib(int n)
{
int a=0,i,b=1,sum;
for(i=0;i<n-2;i++)
{
sum=a+b;
a=b;
b=sum;
printf("%d ",sum);
}
return(sum);
}