max element of a specific array code example
Example: max element in array
int max;
max=INT_MIN;
for(int i=0;i<ar.length();i++){
if(ar[i]>max){
max=ar[i];
}
int max;
max=INT_MIN;
for(int i=0;i<ar.length();i++){
if(ar[i]>max){
max=ar[i];
}