Skip to content

ShaaviGupta/fibonacci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

fibonacci

To generate fibonacci series class Main { public static void main(String[] args) { int n = 10, firstTerm = 0, secondTerm = 1; System.out.println("Fibonacci Series till " + n + " terms:"); for (int i = 1; i <= n; ++i) { System.out.print(firstTerm + ", "); // compute the next term int nextTerm = firstTerm + secondTerm; firstTerm = secondTerm; secondTerm = nextTerm; } } }

About

To generate fibonacci series

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published