In C++ Write the following functions. 1) Int**createArray(int **arr, int row, int colm); In this function just pass 2D pointer ,row and column size as arguments and create 2D dynamic array against received 2D pointer and return the 2D pointer from function. 2) inputArray(int **arr, int row, int colm) Input values in array; 3) displayArray(int **arr, int row, int colm); Display the values of 2D array. 4) sumOfEven(int **arr, int row, int colm); Display the sum of even values into the array. Main function should be something as below. int main(){ int **arr;int row,col; cout<<”enter row: ”; cin>>row; cout<<”enter column: ”; cin>>col; arr=createArray(arr,row,col); inputArray(arr,row,col); displayArray(arr,row,col); sumOfEven(arr, row, col); return 0;}
In C++
Write the following functions.
1) Int**createArray(int **arr, int row, int colm);
In this function just pass 2D pointer ,row and column size as arguments and create 2D dynamic array against received 2D pointer and return the 2D pointer from function.
2) inputArray(int **arr, int row, int colm)
Input values in array;
3) displayArray(int **arr, int row, int colm);
Display the values of 2D array.
4) sumOfEven(int **arr, int row, int colm);
Display the sum of even values into the array.
Main function should be something as below.
int main(){
int **arr;int row,col;
cout<<”enter row: ”;
cin>>row;
cout<<”enter column: ”;
cin>>col;
arr=createArray(arr,row,col);
inputArray(arr,row,col);
displayArray(arr,row,col);
sumOfEven(arr, row, col);
return 0;}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images