We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa3fbfc commit 29eb417Copy full SHA for 29eb417
1 file changed
src/number_Programming/core/day_01/FibonacciSeries.java
@@ -1,18 +1,20 @@
1
package number_Programming.core.day_01;
2
import java.util.Scanner;
3
//12.write a program to produce the fibonacci series
4
-public static void main(String[] args) {
5
- Scanner sc = new Scanner(System.in);
6
- System.out.println("Enter n value : ");
7
- int n = sc.nextInt();
8
- int a = 0;
9
- int b = 1;
10
- for(int i = 1;i<=n;i++)
11
- {
12
- System.out.println(a);
13
- int c = a+b;
14
- a=b;
15
- b=c;
+public class FibonacciSeires
+{
+ public static void main(String[] args) {
+ Scanner sc = new Scanner(System.in);
+ System.out.println("Enter n value : ");
+ int n = sc.nextInt();
+ int a = 0;
+ int b = 1;
+ for(int i = 1;i<=n;i++)
+ {
+ System.out.println(a);
+ int c = a+b;
16
+ a=b;
17
+ b=c;
18
+ }
19
}
20
-}
0 commit comments