write a program to sum the series ( 0+1+1+2+3+5+8........nth term)
Answers
Answered by
0
Answer:
it is a Fibonacci series
Step-by-step explanation:
import java.util.*;
public class sidhant
{
public static void main (String []args)
{
int i,a,b,n;a=0;b=1;
double s;s=0
Scanner in =new Scanner (System.in);
system.out.println("enter the number");
n=in.nextInt();
for(i=0;i<=n;i++)
{
s=a+b;
a=b;
b=s;
system.out.println("Fibonacci series"+s);
}
}
}
i hope this series will helpful
follow me for your queries
Answered by
1
Answer:
class adarsh
{
public static void main (String args [])
{
int sum =0; int f;,int s;,int t;
for(int i= 0; i<=n; i++)
sum=f+s;
System.out.println("sum=+sum);
}
}
Similar questions