+ 1
Please provide the code to print initials of a name in Java
Please provide the code to print the initial of te first name with the last name unchanged. Language: Java/C/C++ Your help will be heartily appreciated.
3 Answers
+ 5
Java:
Scanner sc = new Scanner(System.in);
System.out.println(sc.next().charAt(0) + " " + sc.next());
+ 3
Looking for output like this, I believe:
Input Name
Mark Paramonte
Output
M Paramonte
+ 2
Yes, only the first name should be replaced with the initial character.