8. Write a java program to find and print the second largest and second smallest element in an array.
Answers
Answered by
4
Java Program to Find the Second Largest & Smallest Elements in an Array
- public class SecondLargest_Smallest.
- int n, temp;
- Scanner s = new Scanner(System.
- System. out. print("Enter no. ...
- n = s. nextInt();
- int a[] = new int[n];
- System. out. println("Enter all the elements:");
- for (int i = 0; i < n; i++)
mark ❤️
Similar questions
Social Sciences,
3 months ago
English,
3 months ago
Science,
3 months ago
English,
6 months ago
Math,
6 months ago
English,
11 months ago
Computer Science,
11 months ago