This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
You have put a break once your count reaches 0. So only one set of numbers is printed. You can have another counter whic can be initialised to 5 and decfremented every time you print a "--------------". Then break the for loop only when this new counter becomes zero.(Put another if condition for that.)
Hi ali, If you put a println statment below your number generator I think it may help you to see the reason why you are getting duplicate numbers , just ponder on what the second test in the first if statement is trying to achieve.
an island in the sun <br />with a language of many tongue?
Joined: Mar 01, 2002
Problem resolved, Swati thanks for the help.
Daniel: riddles are not for forums. you should be more helpful. the duplication occurs as all 5 numbers must be compared not just the previous one, as told in the sun forums