Write a program to find the sum of the first 10 numbers of the fibonicci series
Answers
Answered by
1
scanf("%d",&n);
printf("\n Sum of FIBONACCI SERIES: \n");
k=1;
while(k<=10){
f=a+b;
a=b;
b=f;
sum += f;
k++;
}
printf("\n The Sum is %ld",sum);
return 0;
}
#lovelove!
Answered by
2
import java.util.*;
public class Fibonicci
{
public static void main(String args[])
{
int a=0,b=1,c=0,n=3;
System.out.println("The fibonicci series is");
System.out.println(a);
System.out.println(b);
do
{
c=a+b;
System.out.println(c);
a=b;
b=c;
n=n+1;
}
while(n<=10);
}
}
Similar questions
Hindi,
6 months ago
English,
6 months ago
Social Sciences,
6 months ago
Science,
1 year ago
Math,
1 year ago