Write a program in java to accept the name containing first, middle and surname and print the name after removing middle name...
Sample Input.....Ashish Kumar Nehra
Sample Output..... Ashish Nehra
Share
Write a program in java to accept the name containing first, middle and surname and print the name after removing middle name...
Sample Input.....Ashish Kumar Nehra
Sample Output..... Ashish Nehra
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
____________
a program in java to accept the name containing first, middle and surname and print the name after removing middle name.......
import .java util.*;
class name;{
public static void main(){
Scanner sc=new Scanner(System.in);
String n,a,m;
System.out.print("enter name with first middle and last name respectively");
n=sc.nextLine();
a=sc.nextLine();
m=sc.nextLine();
System.out.println(+n+" "+m);
}
}
hope it helps u!!!!!
and u find it helpful....
thank you!!❤️❤️