I tried to do it, I researched it, but I could not. I would like to know if it is possible to identify two larger numbers without using vectors ?
Here's my attempt:
int maior1 = 0,
maior2 = 0;
for(int i = 0; i < 5; i++){
System.out.println(" Digite números:");
int num = sc.nextInt();
if(num > maior1){
maior1 = num;
if(num > maior2){
maior2 = num;
}
}
}
System.out.println(maior1 + "- " + maior2);
}