SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top