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);
}
}