Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. string input[4] = {"Word1", "Word2", "Word3", "Word4"};
  6.  
  7. void in()
  8. {
  9.   cout << "Please enter the first word to be echoed:\n";
  10.   cin >> input[0];
  11.   cout << "Please enter the second word to be echoed:\n";
  12.   cin >> input[1];
  13.   cout << "Please enter the third word to be echoed:\n";
  14.   cin >> input[2];
  15.   cout << "Please enter the fourth word to be echoed:\n";
  16.   cin >> input[3];
  17. }
  18.  
  19. void out()
  20. {
  21.   cout << "Echoed text:\n";
  22.   cout << input;
  23. }
  24.  
  25. int main()
  26. {
  27.   in();
  28.   out();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement