How To Write A Java Program That Displays Fibonacci Sequence?

1

1 Answers

Alongbar Daimary Profile
Here is your Program but it needs compilation for I've no java installed. I directly wrote the code here.
class Fibonacci{
public static void main(String[]arg){
int a=0,b=1,c=0;
int Range=10;
System.out.println("The Sequence is:n"+ a+", "+ b);
for(int I=2;I<=Range;I++){
c=a+b;
System.out.print(", "+ c);
a=b;
b=c;
}
}
}

Answer Question

Anonymous