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
Answered by
3
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);
}
}
hope it helps u!!!!!
and u find it helpful....
thank you!!❤️❤️
____________
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!!❤️❤️
ujjwalusri:
Enter name in one line
Similar questions