Preview:
int[]myArray={1,2,33,56,34,85,32};

 //find maximum number in the array

        int max=0;
        for(int i=0;i<myArray.length;i++)
        {
            if (myArray[i]>max)
            {
                
                max=myArray[i];
            }
        }
        
        System.out.println("maximum num in the array is = " + max);
//find second largest number in the array
        
        int secondLargest = 0;
        
        for(int i=0; i<myArray.length; i++) {
        	if(myArray[i] < max && myArray[i] > secondLargest) {
        		secondLargest = myArray[i];
        	}
        }
        System.out.println("The second Largest num in the array is = " + secondLargest);

//find third largest numbr in the array.
        int thirdLargest = 0;
        for(int i=0; i<myArray.length; i++) {
        	if(myArray[i]< secondLargest && myArray[i]> thirdLargest) {
        		thirdLargest = myArray[i];
        	}
        }
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter