#include<iostream>
#include<cstring>
using namespace std;
int main() {
string name[2];
int age[2];
//get data from user
for(int i = 0; i < 2; i++) {
cout << "enter name\n";
getline(cin, name[i]);
cout << "enter age\n";
cin >> age[i];
cout << endl;
}
for(int i = 0; i < 2; i++) {
cout << "name :" << name[i] << endl;
cout << "age :" << age[i] << endl;
}
}
Asked
Active
Viewed 26 times
-3
-
`
` is the wrong header for `std::string`. Use ` – Casey May 04 '21 at 01:47`.