All pastes #918452 Raw Edit

Someone

public text v1 · immutable
#918452 ·published 2008-02-26 03:05 UTC
rendered paste body
import javax.swing.JOptionPane;

public class ArrayTest{
    
    public static void main(String args[]){
	int evenlist[] = new int[10];
   	int oddlist[] = new int[10];
    	int e=0, o=0;
        String s;
        int x;
        for(int i=0;i<10;i++){
            s = JOptionPane.showInputDialog("Enter the number");
            x = Integer.parseInt(s);
            if(x % 2 == 0){
                evenlist[e]=x;
                e++;
            }else{
                oddlist[o]=x;
                o++;
            }
        }       
        
        String outp = "Even List =";
        for(int j=0;j<e;j++){
            outp += evenlist[j] + " ";
        }
        outp += "\n Odd List = ";
        for(int j=0;j<o;j++){
            outp += oddlist[j] + " ";
        }
        JOptionPane.showMessageDialog(null,outp);
        System.exit(0);
    }
    
    
}