0

how to find minimum element in an array using Math.min() function ?

2nd Jul 2016, 7:01 AM
Kurapati Praveen
Kurapati Praveen - avatar
2 Answers
0
int[] a={34,76,39,56};//take any array int min_no=a[0]; for(int i=1;i<a.length;i++) min_no=Math.min(min_no,a[i]); System.out.println(min_no);
2nd Jul 2016, 7:24 AM
Prince Yadav
Prince Yadav - avatar
0
In argument pass array name and print the function
1st Aug 2016, 10:41 AM
Akshay KG
Akshay KG - avatar