Write a Program to Calculate Fibonacci Series using Do-while Loop for Java
public class fibonacci { public static void main(String []args) { int pre = 0; int next - 1; int current; System.out.println(pre); System.out.println(next);
do { current = next + pre; System.out.println(current); pre = next; next = current; } while(next<=100); } }
1 comments:
Int next=1;
Post a Comment