diff --git a/GOLDEN RATIO (VA) 110.java b/GOLDEN RATIO (VA) 110.java new file mode 100644 index 0000000..abfda92 --- /dev/null +++ b/GOLDEN RATIO (VA) 110.java @@ -0,0 +1,17 @@ +// GOLDEN RATIO +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 + ", "); + + // Lets compute the next term + int nextTerm = firstTerm + secondTerm; + firstTerm = secondTerm; + secondTerm = nextTerm; + } + } +}