fork download
  1. ///Version 2
  2.  
  3. #include<iostream>
  4. using namespace std;
  5. void display();
  6. int main()
  7. {
  8. display();
  9. // I can ask the user to enter his name and have it display back again by reusing the display() function
  10. display();
  11. return 0;
  12. }
  13. void display()
  14. {
  15. string name;
  16. cout<<"Enter the Nmae\n";
  17. cin>>name;
  18. cout<<"Name is\t"<<name<<endl;
  19. }
  20.  
Success #stdin #stdout 0.01s 2860KB
stdin
george
agdgdgdgwngo
stdout
Enter the Nmae
Name is	george
Enter the Nmae
Name is	agdgdgdgwngo