Computer Science, asked by arbaazhussain0611, 4 months ago

8. Write a java program to find and print the second largest and second smallest element in an array.​

Answers

Answered by Zayn009
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