info@thistimebd.com

Thursday 21st of November 04:02:40pm

Write a user defined function named display() that receives an integer array and then add 10 with all the elements.

Write a user defined function named display() that receives an integer array and then add 10 with all the elements. 

Sol:

#include

using namespace std;


func(int arr[], int n)

{


    for (int i = 0; i < n; i++)

        arr[i]=arr[i]+10;

}


int main()

{

    int arr[] = {10, 10, 10};

    int n = sizeof(arr) / sizeof(arr[0]);


    func(arr, n);

    for(int i=0;i

    {

        cout<

    }

    return 0;

}