We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25e620e commit f9747bfCopy full SHA for f9747bf
src/PrintFibonacciSeries.java
@@ -0,0 +1,21 @@
1
+public class PrintFibonacciSeries {
2
+
3
+ public static void printFibonacciSeries(int count) {
4
+ int a = 0;
5
+ int b = 1;
6
+ int c = 1;
7
+ for (int i = 1; i <= count; i++) {
8
+ System.out.print(a + ", ");
9
+ a = b;
10
+ b = c;
11
+ c = a + b;
12
+ }
13
+}
14
15
+ public static void main(String args[]) {
16
17
+ // don't exceed it hehe
18
+ printFibonacciSeries(40);
19
20
21
0 commit comments