this simple program fails to proceed

closed account (EAXiz8AR)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
using namespace std;

int main()
{
char greet[] = "Welcome";
int age;
string country;


cout << "Please enter your age: ";
cin >> age;
cout << "Please enter your country of origin: ";
getline(cin, country);
cout << greet << ", " << age << " " << country;


return 0;

}



When I run the above code, I enter my age, but then the program immediately outputs "Welcome, <age>"

can you guys help me with whats wrong in this code. thanks
Topic archived. No new replies allowed.