Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int num_names = 5;
- string friend_list[5];
- cout << "Enter five names\n";
- for (int index = 0, num_friend = 1; index < 5; index++, num_friend++)
- {
- cout << "Enter friend " << num_friend << endl;
- cin >> friend_list[index];
- }
- cout << "Here are all of those names\n";
- for (int index = 0, num_friend = 1; index < 5; index++, num_friend++)
- {
- cout << "Friend " << num_friend << " is " << friend_list[index] << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment