Computer Science, asked by harshitha855277, 3 months ago

Accept names of any 2 pupils and their height.display the name of the tallest person in java​

Answers

Answered by BrainlyProgrammer
1

Answer:

//Assuming it is Java programming

import java.util.*;

public class HtTall{

public static void main (String ar[]){

Scanner sc=new Scanner (System.in);

int a,b; //Height variable

String ab,bc; //Name variable

System.out.println("Enter name and height of 1st person");

int a=sc.nextInt();

String ab=sc.nextLine();

System.out.println("Enter name and height of 1st person");

int b=sc.nextInt();

String bc=sc.nextLine();

if(a>b)

System.out.println("Name:"+ab);

else

System.out.println("Name:"+bc);

}

}

•••♪♪

Similar questions