Advertisement
Guest User

FiftTry

a guest
May 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5.  
  6. {
  7. const int A = 15;
  8. int x;
  9. int myArray[A] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
  10.  
  11. cout << "Enter a number from 1 to 15" << endl;
  12. cin >> x;
  13. for (int x = 0; x < A; x++)
  14. {
  15. if (myArray[x] == x)
  16. {
  17. break;
  18. }
  19. cout << myArray[x] << " ";
  20. }
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement