An inspiring Array Program
To learn more array programshttps://wordpress-343193-1101484.cloudwaysapps.com/sum-of-boundary-elements-of-a-matrix
The maximum and minimum element of the array:-This program will print the biggest and the smallest element with its respective indexes(subscript)
To learn more array programs
A Simple program: Sum of Boundary elements of a Matrix
class maxmin{
public static void main(){
int arr[]={3,5,78,23,56,90,12,34,1,6,88,65,46,28,72,12};
System.out.println("The array is:");
int l=arr.length; for(int i=0;i<l;i++){
System.out.print(arr[i]+" ");
}
int min=arr[0];
int max=arr[l-1];
int mxp=0,mnp=0;
for(int i=0;i<l;i++){
if(arr[i]>max){
max=arr[i];
mxp=i;
}
}
for(int j=0;j<l;j++){
if(arr[j]<min){
min=arr[j];
mnp=j;
}
}
System.out.println("\nmax:"+max+" at position"+mxp);
System.out.println("min:"+min+" at position "+mnp);
}Output:-
The array is:
3 5 78 23 56 90 12 34 1 6 88 65 46 28 72 12
The Maximum number is:90 at position 5
The minimum number is:1 at position 8
For videos related to java programming
http://www.youtube.com/user/trushnatej
Related Posts
Continue learning with these related articles

String Methods in Java for ICSE Class 10: 25 Output Questions with Answers
ICSE Class 10 Computer Applications practice on String class methods: length, charAt, indexOf, lastIndexOf, substring, replace, trim, compareTo, equals and more, with 25 board-style output questions and step-by-step answers.

Special Number Programs in Java for ICSE: Armstrong, Spy, Neon, Disarium, Pronic and More
Every special number asked in ICSE Computer Applications – prime, perfect, Armstrong, palindrome, automorphic, neon, spy, Niven, duck, buzz, Disarium, special and pronic numbers – with definitions, examples and one complete Java program that checks them all.

Math Library Methods in Java for ICSE Class 9 (with Outputs)
ICSE Class 9 Computer Applications notes on the Java Math class: sqrt, cbrt, pow, abs, max, min, ceil, floor, round, rint and random, with return types, tricky negative-number outputs and Java expressions for formulas.