Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- const int A = 15;
- int x;
- int myArray[A] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
- cout << "Enter a number from 1 to 15" << endl;
- cin >> x;
- for (int x = 0; x < A; x++)
- {
- if (myArray[x] == x)
- {
- break;
- }
- cout << myArray[x] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement