fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. cout << "please enter your first name and age\n"; //prompts user to enter name and age
  8. string first_name; //string variable
  9. int age; //integer variable
  10. cin first_name; //reads first_name
  11. cin age; //reads age
  12. cout << "Hello " << first_name << " (age" << age << ")\n";
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:10:6: error: expected ';' before 'first_name'
  cin first_name; //reads first_name
      ^
prog.cpp:11:6: error: expected ';' before 'age'
  cin age; //reads age
      ^
stdout
Standard output is empty