Hi every one !
Guys i am trying to do the Fibonacci numbers without an input
just want it to number 8 then stop, But i want to do it using Do While
i did it but , i am missing something i can't find what is it its won't repeat.
i mean the output of this code 01 cuz i print it out but
after that it print only 1, like this 011. why? it won't repeat with count .
class Fp
{
public static void main (String args[])
{
int a=0;
int b=1;
int count=0;
System.out.print("01");
do {
b= a + b;
a= b - a;
b= a + b -a;
System.out.println(+b);
count++;
}
while (count>8);
}
}
Thank you !