info@thistimebd.com

Friday 26th of April 09:56:29am

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;

}