Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

find minimum number in array java

public class MinimumNumber{
  public static void main(String[] args){
    int[] arr=new int[]{2,3,4,1};
    int min=arr[0];
    for(int i=0;i<arr.length;i++){
      if(arr[i]<min){
        min=arr[i];
      }
    }
    System.out.println("Minimum Number in array:"+min);
  }
}
 
PREVIOUS NEXT
Tagged: #find #minimum #number #array #java
ADD COMMENT
Topic
Name
8+9 =