import java.util.Scanner;
class Fabonicci
{
public static void main(String[]args)
{
int num, a=0,b=0,c=1;
Scanner in =new Scanner(System.in);
System.out.println("Enter the number how much fabinnocies");
num=in.nextInt();
System.out.println("Fabbonic Series of the number is");
for(int i=0;i<=num;i++)
{
a=b;
b=c;
c=a+b;
System.out.println(a+"");
}
}
}
for(int i=0;i<=num;i++)
{
a=b;
b=c;
c=a+b;
System.out.println(a+"");
}
class Fabonicci
{
public static void main(String[]args)
{
int num, a=0,b=0,c=1;
Scanner in =new Scanner(System.in);
System.out.println("Enter the number how much fabinnocies");
num=in.nextInt();
System.out.println("Fabbonic Series of the number is");
for(int i=0;i<=num;i++)
{
a=b;
b=c;
c=a+b;
System.out.println(a+"");
}
}
}
for(int i=0;i<=num;i++)
{
a=b;
b=c;
c=a+b;
System.out.println(a+"");
}
0 comments:
Post a Comment