//Fibbonacci Series
import java.io.*;
class Fibbo
{
public static void main(String arr[])
{
int num=0,a=0,b=1,c=0;
System.out.println("Enter The Number of Elements in Series..");
try
{
DataInputStream dis=new DataInputStream(System.in);
num=Integer.parseInt(dis.readLine());
}
catch(Exception e){}
System.out.println("Fibbonacci Series is:- ");
System.out.print(" "+a);
System.out.print(" "+b);
for(int i=0;i
{
c=a+b;
System.out.print(" "+c);
a=b;
b=c;
}
}
}
No comments:
Post a Comment