Computer Science, asked by lolklokd, 12 hours ago

write a program to input name and percentage of 5 student and print the name of the topper in java​

Answers

Answered by ajaykumarrj3000
1

Answer:

import java.util.Scanner;

class Students

{

public static void main(String[] args)

{

String n[] = new String[35];

int p[] = new int[35];

Scanner in = new Scanner(System.in);

for (int i = 0; i < 35; i++)

{

System.out.print("Enter name " + (i + 1) + ": ");

n[i] = in.nextLine();

System.out.print("Enter percentage: ");

p[i] = in.nextInt();

in.nextLine();

}

//selection sort

int l=p.length;

for (int i=0; i<l-1; i++)

{

int pos = i;

for (int j=i+1; j<l;

Similar questions