import java.util.Scanner;
public class nomor2 {
public static void main (String []args) {
Integer totalgenap,totalganjil,totalpositiv,totalnegatif,nilai;
int max=Integer.MIN_VALUE;
int min=Integer.MAX_VALUE;
Scanner input = new Scanner(System.in);
totalgenap=0;
totalganjil=0;
totalpositiv=0;
totalnegatif=0;
do {
System.out.print("Nilai : ");
nilai=input.nextInt();
if (nilai%2==0)
totalgenap+=nilai;
else
totalganjil+=nilai;
if (nilai>0)
totalpositiv+=nilai;
else
totalnegatif+=nilai;
if(nilai>max)
max=nilai;
if(nilai<min)
min=nilai;
} while (nilai!=0);
System.out.printf("\nBilangan Terbesar : %d\n",max);
System.out.printf("Bilangan Terkecil : %d\n",min);
System.out.printf("Total Nilai Bilangan Ganjil : %d\n", totalganjil);
System.out.printf("Total Nilai Bilangan Genap : %d\n", totalgenap);
System.out.printf("Total Nilai Bilangan Positif: %d\n", totalpositiv);
System.out.printf("Total Nilai Bilangan Negatif: %d\n", totalnegatif);
System.out.printf("\n");
}
}
Contoh outputnya :