View Single Post
  #2 (permalink)  
Old 07-31-2007, 06:01 AM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,266
hardwired is on a distinguished road
Code:
import javax.swing.JOptionPane; public class CountingRx { public static void main(String args[]) { String temp = ""; int count=0; int j = 1; while (j <= 50) { j++; if(j % 2 == 0) // test for an even number { count++; temp += " " + j; if(count % 5 == 0) temp = temp + "\n"; } } JOptionPane.showMessageDialog(null, "The output is "+ temp); System.exit(0); } }
Reply With Quote