Write a C program to read in a 2-dimestional arrays and store this array in ARY
ID: 3660231 • Letter: W
Question
Write a C program to read in a 2-dimestional arrays and store this array in ARY whose dimensions M and N are read in.
A) Write a function called COPYR that will copy all the elements of the given double array ARYrow by row to a single array called VCTR
B) Write a function called COPYC that will copy all the elements of the
Given double array ARY column by column to a single array called VCTC
C) Write a function called POLYNOMIAL that will calculate all the elements of the double array ARY one by one with the given polynomial function called POLY. You will store the new doublearray values to CALCULATED double arrays.
POLY(X) = 2X3 + 5X2 + 3Sin(X) ? 4COS(X)
The double array ARY given as:
2.1 3.5 1.1 5.5
ARY = 0.5 3.5 4.6 0.75
5.3 0.95 0.3 1.2
b) Display the given matrix and calculated matrix and arrays with a proper formatting.
Explanation / Answer
#include #include const int M=3; const int N=4; void COPYR(double[][N],double[]); void COPYC(double[][N],double []); void POLYNOMIAL(double[][N],double[][N]); int main(){ int i,j; double ARY[M][N]; double CALCULATED[M][N]; double VCTR[M*N]; double VCTC[M*N]; for(i=0;iRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.