My program prints out Fibonacci_number(0,1,1,2,3,5). The program is ok.
My problem:I want to take a number from Fibonacci_number(0,1,1,2,3,5)
and multiply whit 10. ex: I want to take 3 and multiply with 10.
I tried to write another function and call a Fibonacci_number from fib(int k)
and then multiply it whit 10.
How can I call an exact Fibonacci_number.
Code:
int fib(int k)
{
int my_nbr=0;
int f;
int nbr1 = 0;
int nbr2 = 1;
printf("0,1");
for (f = 2; f < k; ++f)
{
printf(",%d", nbr1 + nbr2);
my_nbr= nbr2;
nbr2 = nbr2 + nbr1;
nbr1 = my_nbr;
}
printf("\n");
}
int main(void)
{
fib(6);
return 0;
}