Fibonacci Series Using JAVA
More Details About Fibonacci Series: Click Here
Program in JAVA
public class fibo{
public static void main(String args[]){
int no=10;
int next,prev,sum;
next=1;
prev=0;
for(int i=0;i<no;i++){
System.out.print(prev+" ");
sum=next+prev;
prev=next;
next=sum;
}
}
}
No comments:
Post a Comment