fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. int age;
  7. string fullName;
  8. cout << "Enter your age: ";
  9. cin >> age;
  10. cout << age << endl;
  11. cin.ignore();
  12. cout << "Enter your full name: ";
  13. getline(cin, fullName);
  14. cout << fullName << endl;
  15. cout << "Your name is ";
  16. cout << fullName;
  17. cout << " and your age is ";
  18. cout << age;
  19. cout << ".";
  20. return 0;
  21. }
Success #stdin #stdout 0s 3460KB
stdin
25
Jane Doe
stdout
Enter your age: 25
Enter your full name: Jane Doe
Your name is Jane Doe and your age is 25.