Write a program to find the first 10 numbers of Fibonacci series (i.e. 1, 1, 3, 5, 8, 13…..) Fibonacci series is such a series which start from 1 and 1and subsequent numbers are the sum of the previous two numbers.
Answers
Answered by
0
Answer:
a=0;
b=1;
c=0;
n=1;
print(a,b)
while(n<=10):
c=a+b;
print(c)
a=b
b=c
n=n+1;
Explanation:
This is the code written in Python.
Output is attached look at that
And the logic is same in all language
HOPE IT HELPS YOU
DO FOLLOW FOR MORE PROGRAMS
MARK AS BRAINLIEST
Attachments:
Answered by
2
Question:
Write a program to find the sum of 1st 10 numbers of Fibonacci series, i.e. 1,1,2,3,5,8,13…. Fibonacci series is such a series which starting from 1 and 1, and subsequent numbers are the sum of the previous two numbers.
Solution:
Language used: Java
public class FibSum
{
static void main()
{
int i,a=1,b=0,c;
System.out.println("Fibonacci series =");
for(i=1;i<=10;i++)
{
c=a+b;
System.out.print(c+" ");
a=b;
b=c;
}
}
}
Similar questions
Hindi,
2 months ago
English,
2 months ago
Science,
2 months ago
World Languages,
10 months ago
Computer Science,
10 months ago