fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. int *arr = new int[15];
  5.  
  6. for (int i = 0; i < 5; i++)
  7. arr[i] = 2 * i;
  8.  
  9. for (int i = 0; i < 5; i++)
  10. cout << arr[i] << " ";
  11. cout << endl;
  12.  
  13. delete[] arr;
  14.  
  15. for (int i = 0; i < 5; i++)
  16. arr[i] = 3 * i + 1;
  17.  
  18. for (int i = 0; i < 5; i++)
  19. cout << arr[i] << " ";
  20. cout << endl;
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
0 2 4 6 8 
1 4 7 10 13