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
7 odpowiedzi
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
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.
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
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
- 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?