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
Answers & Comments
Saloni001
Hello mate!!☺️ ____________ 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); } }
Answers & Comments
____________
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!!❤️❤️