It's simple .
Before displaying that number check whether it an even number
while( num3 <= 377){ //loop ends after calculating the first 15 fibonacci numbers
num3 = num1 + num2;
if ( num3 % 2 == 0 )
System.out.println(num3 + "*");
num1=num2;
num2=num3;
}
not after displaying
No need for this code fragment
/*if ( num3 % 2 == 0 );
System.out.println(num3 + "*");
num1 = num2;
num2 = num3; */
greetings
Parthiban
parthiban
Junior Poster in Training
80 posts since Sep 2006
Reputation Points: 10
Solved Threads: 6