We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68c9cd1 commit fbb44f0Copy full SHA for fbb44f0
1 file changed
Fibonacci.java
@@ -0,0 +1,19 @@
1
+//https://www.facebook.com/permalink.php?story_fbid=1487036478350636&id=100011328934717
2
+//Subscribed by Teaam orange
3
+public class Fibonacci {
4
+
5
+ public static void main(String[] args) {
6
7
+ int n = 10, t1 = 0, t2 = 1;
8
+ System.out.print("First " + n + " terms: ");
9
10
+ for (int i = 1; i <= n; ++i)
11
+ {
12
+ System.out.print(t1 + " + ");
13
14
+ int sum = t1 + t2;
15
+ t1 = t2;
16
+ t2 = sum;
17
+ }
18
19
+}
0 commit comments