Java, Selenium , Testing and Interview Questions and answers
Pages
Home
Java Programming
Selenium testNG Junit
Testing
Interview Questions
Saturday, August 18, 2012
Printing the Fibonacci Series using Java
public class FibonaciN {
public static void main(String args[])
{
int prev, next, sum, n;
prev=next=1;
for(n=1;n<=9;n++)
{
System.out.println(prev);
sum=prev+next;
prev=next;
next=sum;
}
}
}
No comments:
Post a Comment
Thanks for your valuable comments
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Thanks for your valuable comments