Question: simple c++ urgent Question 1 [1D Dynamic Array]: Write a function that takes a pointer to an array of integers values and print the odds
simple c++ urgent
Question 1 [1D Dynamic Array]: Write a function that takes a pointer to an array of integers values and print the odds values out of them. void printOdds(int *values, int size); Write a main program to dynamically create an array of 10 elements, read their values from the user, and call the function to print the odd values.
Question 2 [2D Dynamic Array]: Write the following function: double maxInArray(double **arr, int rows, int cols) The function should return the maximum value out of all numbers that are stored in the 2D array arr which consists of rows rows each with cols columns. In the main, create a dynamic 2D array of doubles (where number of rows and columns to be read from the user) then ask the user for the array content and finally print the maximum value of all numbers with the help of the maxInArray function.
Write a function that takes a pointer to an array of integers values and print the odds values out of them. void print.dds(int *values, int size); Write a main program to dynamically create an array of 10 elements, read their values from the user, and call the function to print the odd values. A sample run is given below: Please enter 10 values : 1 2 3 3 5 7 8 1 4 7 The odd values in the array are : 1 3 3 5 7 1 7 Question 2 [2D Dynamic Arrayl: Write the following function: double maxInArray[double **arm, int rows, int cols) The function should return the maximum value out of all numbers that are stored in the 2D array arr which consists of rows rows each with cols columns. In the main, create a dynamic 2D array of doubles (where number of rows and columns to be read from the user) then ask the user for the array content and finally print the maximum value of all numbers with the help of the maxInArray function. A sample run is given below: Enter Rows and Cols : 2 3 A[0][0] = -2 A[0][1] = -3 A[@][2] = 1 A[1][0] = 2 A[1][1] = 4.5 A[1][2] = 6.5 The maximum value of all numbers is : 6.5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
