FIND THE SMALLEST ELEMENT OF AN ARRAY
import java.util.Scanner; class SmallestEle { public static void main(String[] args) { Scanner s=new Scanner(System.in); System.out.println("enter size of Array"); int x=s.nextInt(); int[] arr=new int[x]; for(int i=0;i<x;i++) { arr[i]=s.nextInt(); } System.out.println(SmallestEle(arr,x)); } static int SmallestEle(int[] a,int size) {int min=a[0]; for(int i=1;i<size;i++) { if(a[i]<min) min=a[i]; } return min; } }