To write a program that reads a person name in the following format: first name then middle name or initial, and then last name. the program then output the name in the following format:

Last_name, First_name , Middle initial.

Example the input

Mary Average User

should produce output

User, Mary A.

How about you give it a go and we'll see how it goes from there.
Be sure to use code tags when posting code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.