Guest User

Untitled

a guest
Nov 23rd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <cstdlib>
  4. using namespace std;
  5.  
  6. void create(int a) //create and print array to check if results are accurate
  7. {
  8.     int i;
  9.     for (i=0; i<10; i++)
  10.         {a[i]= rand();
  11.         cout << a[i] << endl;}
  12. }
  13. int main() {
  14.     int* a = NULL;
  15.     a = new int[10];
  16.     create (a);
  17.     cout << "Press and enter a to set all cells to zero for the array. Press and enter b to square the "
  18.             "value in every cell. Press and enter c to find the sum of the squares of the array. "
  19.             "Press and enter d to 1 find the smallest index whose cell contains a value larger than "
  20.             "that stored in: int v; (If no such index exists, it will return -1.) Press e to reverse the"
  21.             "contents of a[]. Press f to print out its cycle." << endl;
  22.     return 0;
  23. }
Add Comment
Please, Sign In to add comment