Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int principleNum;
  7.  
  8. ofstream myFile;
  9.  
  10. int main()
  11. {
  12.  
  13.     cout << "How Many principes do you have?\n";
  14.     cin >> principleNum;
  15.        
  16.     int* dList;
  17.  
  18.     dList = new int[principleNum];
  19.    
  20.     for (int k = 0; k < principleNum; k++)
  21.     {
  22.         cout << "Input Value\n";
  23.         cin >> dList[k];
  24.         cout << endl;
  25.     }
  26.  
  27.     for (int i = 0; i < principleNum; i++)
  28.     {
  29.         cout << dList[i] << endl;
  30.     }
  31.  
  32.     myFile.open("PrincipleNum.txt");
  33.     if (myFile.is_open())
  34.     {
  35.  
  36.     }
  37.        
  38.    
  39.    
  40.     delete[] dList;
  41.  
  42.     return 0;
  43. }
  44.  
  45. //The array is called "dList".
  46. //Able to contain a user defined size and input values.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement