fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. void print (int x[], int n){
  4. for(int i = 0; i < n; i++){
  5. cout << x[i] << " ";
  6. }
  7. cout << endl;
  8. }
  9.  
  10. int main(){
  11. int arr[5] = {1, 2, 3, 4, 5};
  12.  
  13. print(arr, 5);
  14. }
Success #stdin #stdout 0.01s 5328KB
stdin
Standard input is empty
stdout
1 2 3 4 5