This blog is for Automation Test Engineers

Thursday 15 March 2018

Fibonacci Sequence

int first=0;
int second=1;
int next;
Scanner in=new Scanner(System.in);
System.out.println("Enter the number");
int n=in.nextInt();
for(int i=o;i<n;i++){
next=first+second;
System.out.println(next);
first=second;
second=next;


0

0 comments:

Post a Comment