2
I tried to do, I researched about it, but I could not. I wonder if it is possible to identify two larger numbers without the use of vectors?
Follow 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);
}
Thank you. I get it.
– Aline