Hi every body
i have a Question
How to find lowest number?
this my code
is there any mistake ?
import java.util.Scanner;
public class MaxNumber {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int min = 0 ; int count=1;
System.out.println("Enter a number : ");
int num=input.nextInt();
for(;;){
if(num==0)
break;
if(num<=min){
num=min;
count=0;
}
if (num==min)
count++;
System.out.println("Enter a number : ");
num=input.nextInt();
}
System.out.println("The min number is : " + min );
System.out.println("The occurrence count of the min number is : " + count);
}
}