Write a C++ program that takes a string containing a full name, and outputs each part of the name separately. The name should be | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write a C++ program that takes a string containing a full name, and outputs each part of the name separately. The name should be

guys please help can anyone work this out for me

3rd Mar 2017, 12:42 AM
Wills Rockson
Wills Rockson - avatar
5 Answers
0
I wanted this... For example, if the name string contains “John Jacob Schmidt” then the program would output: First name: John Middle name: Jacob Last name: Schmidt
3rd Mar 2017, 1:03 AM
Wills Rockson
Wills Rockson - avatar
0
Write a C++ program that reads your Full Name (First, Second and Last name) from a file into an array of size 30. Extract first, second and third name from the given full name and store them in three different arrays (e.g., firstName[], secondName[] and thirdName[]) of size 10 each. Display full name and extracted parts of the name in another text file.
10th Nov 2019, 9:12 AM
Osama Ayub
Osama Ayub - avatar
0
1. Write a program to display your fullname 2. Write a program to display your father's fullname 3. Write a program to display your mother's fullname 4. Write a program to display your brother or sister fullname
15th Dec 2019, 8:22 AM
michael sagoe
0
1. Write a program to display your fullname 2. Write a program to display your father's fullname 3. Write a program to display your mother's fullname 4. Write a program to display your brother or sister fullname
5th Apr 2021, 7:48 PM
Mina Ba
Mina Ba - avatar
- 2
#include <iostream> #include <string> using namespace std; int main() { string name; cout << "Input name" << endl; cin >> name; for(int i =0; i < name.size(); i++){ cout << name[i] << endl; } } This will take the string name and output each letter individually. Is this what you wanted to do?
3rd Mar 2017, 1:00 AM
Rain
Rain - avatar