Skip to content

Commit 5967dc7

Browse files
committed
Added Fibonacci program by Aashi Sharma for Hacktoberfest
1 parent 873dd97 commit 5967dc7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
public class fibonacci_series {
2+
public static void main(String[] args) {
3+
int n1 = 0, n2 = 1, n3, count = 10;
4+
System.out.print("Fibonacci Series: " + n1 + " " + n2);
5+
for (int i = 2; i < count; ++i) {
6+
n3 = n1 + n2;
7+
System.out.print(" " + n3);
8+
n1 = n2;
9+
n2 = n3;
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)