Professional Documents
Culture Documents
int sum_even=0;
int sum_odd=0;
int j;
for( int i=0 ; i<array.length; i++ )
{
array[i]=Integer.parseInt(JOptionPane.showInputDialog("enter the value
of array["+i+"]"));
System.out.println("show the value of array"+array[i]);
}
for ( j=0; j<array.length;j++){
if (array[j]%2==0){
sum_even=sum_even+array[j];
System.out.println(" the no is even = "+array[j]);
}
else {
sum_odd=sum_odd+array[j];
System.out.println(" the no is odd = "+array[j]);
}
}