-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFibo.java
More file actions
41 lines (35 loc) · 701 Bytes
/
Copy pathFibo.java
File metadata and controls
41 lines (35 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package sukanta;
public class Fibo {
private int a;
private int b;
private int c;
private int num;
Fibo()
{
a = 0;
b = 1;
c = 0;
num = 10;
}
void cal_dis()
{
System.out.println("The Fibonacci Series of "+num+" items :\n");
System.out.println(" "+a);
System.out.println(" "+b);
for(int i=1; i<=num-2; i++)
{
c = a+b;
a=b;
b=c;
System.out.println(" "+c);
}
}
/**
* @param args
*/
public static void main(String[] args) {
Fibo f1 = new Fibo();
f1.cal_dis();
// TODO Auto-generated method stub
}
}