Home » Sometech » The Fibonacci sequence is defined by the following rule: The first two values in the sequence are 1 and 1.

The Fibonacci sequence is defined by the following rule: The first two values in the sequence are 1 and 1.

Java Coding

class febi

{

public stAtic void main(String arg[])

{

int a=1,b=1,s=0,n=25;

while(s<=n)

{

System.out.println(s);

s=a+b;

a=b;

b=s;

}

}

}

Advertisements

SoME Tech

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

%d bloggers like this: