-3
#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;
    }
}
Casey
  • 8,686
  • 9
  • 52
  • 79
Rock Star
  • 1
  • 1

0 Answers0