Sinux1

PS7Q4.cpp

Apr 13th, 2016
98
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. using namespace std;
  3.  
  4.  
  5.  
  6. int main()
  7. {
  8.     int num_names = 5;
  9.     string friend_list[5];
  10.  
  11.    cout << "Enter five names\n";
  12.  
  13.    for (int index = 0, num_friend = 1; index < 5; index++, num_friend++)
  14.         {
  15.             cout << "Enter friend " << num_friend << endl;
  16.             cin >> friend_list[index];
  17.         }
  18.  
  19.     cout << "Here are all of those names\n";
  20.  
  21.     for (int index = 0, num_friend = 1; index < 5; index++, num_friend++)
  22.         {
  23.             cout << "Friend " << num_friend << " is " << friend_list[index] << endl;
  24.         }
  25.  
  26. return 0;
  27. }
Add Comment
Please, Sign In to add comment