CPP   30

array-example.cpp

Guest on 14th January 2022 10:31:18 AM

  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int MAX=5;
  5.  
  6. void array_10(int a[],int size) {
  7.     for(int i=0;i<size;i++)
  8.         a[i]*=10;
  9. }
  10.  
  11.  
  12. void print_array(int a[],int size) {
  13.     for(int i=0;i<size;i++)
  14.         cout << a[i] << " ";
  15. }
  16.  
  17. int main() {
  18.     int a[]={1,2,3,4,5};
  19.  
  20.     array_10(a,MAX);
  21.     print_array(a,MAX);
  22. }

Raw Paste


Login or Register to edit or fork this paste. It's free.