Tuesday, 13 December 2016

Java Program to Convert a person's name in Abbreviated

Abbreviated Name :- Abbreviated Is A Sort name we can say that if your name is Ghanendra Pratap Yadav Then your Abbreviated  (Sort Name ) Will be G.P.Yadav

See Also :- C++ Program to Convert a person's name in abbreviated 

Solution :-

/* Program By Ghanendra Yadav
   Visit http://www.programmingwithbasics.com/
*/
import java.util.Scanner;
import java.io.*;
class abbreviated 

public static void main(String[] args) throws IOException 
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));


System.out.print("\nEnter your Fisrt name:\t");
char firstname=br.readLine().charAt(0);

System.out.print("\nEnter middle Name:\t");
char midname=br.readLine().charAt(0);

System.out.print("\nEnter your last name:\t");
String lastname=br.readLine();

System.out.println("\n Abbreviated Name:\t"+firstname+"."+midname+"."+lastname);

}
}

See Also :- C Program to Convert a person's name in abbreviated 

output:-


Java Program to Convert a person's name in Abbreviated

No comments:
Write comments

Recommended Posts × +