Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. const int N = 10;
  4. typedef int A[N];
  5. void func(int arr[], int n);
  6. int main() {
  7. int n;
  8. const int r = 10;
  9. int A[r];
  10. cout << "Elements: |";
  11. for (int r = 0; r < N; r++)
  12. {
  13. A[r] = rand() % 10;
  14. cout << A[r] << "|";
  15. }
  16. n = N;
  17. func(A, n);
  18. return 0;
  19. }
  20. void func(int arr[], int n)
  21. {
  22. n = N;
  23. for (int i = 11 - 1; i >= 0; i--)
  24. {
  25. cout << arr[i] << endl;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement