1// Aim: Program to perform Fibonacci Series.
2import java.util.*;
3public class FibonacciSeries {
4 public static void main(String[] args) {
5 System.out.print("Enter the range: ");
6 Scanner sc = new Scanner(System.in);
7 int n = sc.nextInt();
8 int a = 0;
9 int b = 1;
10 int c = 0;
11 System.out.print(a+" "+b+" ");
12 for(int i=2;i<n;i++)
13 {
14 c = a+b;
15 System.out.print(c+" ");
16 a = b;
17 b = c;
18 }
19 sc.close();
20 }
21}
22