Advertisement
Sinux1

PS7Q1.cpp

Apr 14th, 2016
126
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. #include <cstdlib>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int inputx;
  8.  
  9.  
  10.     cout << "How many integers do you have? (Max 20)\n";
  11.     cin >> inputx;
  12.  
  13.  
  14.         int num_array[inputx];
  15.  
  16.         for(int x = 0; x < inputx; x++)
  17.         {
  18.             cout << "Enter element for subscript " << x << endl;
  19.             cin >> num_array[x];
  20.         }
  21.  
  22.         cout << "Here are all of those numbers\n";
  23.  
  24.         for (int x = 0; x< inputx; x++)
  25.         cout << num_array[x] << endl;
  26.  
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement