ok so im suppose to use fibonicci number
"The sequence of integers 1,1,2,3,5,8,13....has been name the fibonacci sequence in honor of mathematician. the first two fibonacci numbers (0 and 1st) are both1; thereaftereach number in the sequence is the sum of the two preceding numbers. Write a program that prompts the user for an integer,m,then prints the mth fibonacci number."
Code:
/* Fibonacci Numbers
Daniel Latorre
CSCI 143 */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
int fibo,m,c;
printf("give me m: ");
scanf("%i",&m);
if(m<0){
printf("Enter an appropiate positive integer");
}
else {
for(c=0;c<m;c++)
{
}
printf("The %i Fibonacci number is: %i",m,fibo);
i havent done much after that cause im stuck in the part of the equation.....how can i make the for loop add the sum of the previous numbers?
any help is appreciated