Q:Print fibonacci series using do while loop?
Anónimo
I solved this question in this way:- int firstVal= 0; int secondVal = 1; int currVal; System.out.println(prevPrevVal); System.out.println(prevVal); do { currVal = firstVal + secondVal; System.out.println(currVal); firstVal = secondVal; secondVal = currVal; } while (secondVal <= 100); And they replied good.