Question: Convert this C++ program to C Program #include int main() { int m=6,n=8; int A[6][8] = { {1, 2, 3, 4, 5, 6, 7, 8}

Convert this C++ program to C Program
#include
int main()
{
int m=6,n=8;
int A[6][8] = {
{1, 2, 3, 4, 5, 6, 7, 8} ,
{2, 3, 4, 5, 6, 7, 8, 9} ,
{3, 4, 5, 6, 7, 8, 9, 10} ,
{4, 5, 6, 7, 8, 9, 10, 11} ,
{5, 6, 7, 8, 9, 10, 11, 12} ,
{6, 7, 8, 9, 10, 11, 12, 13}
};
int X[8]={1,-8,3,-6,5,-4,7,-2};
int Y[8];
for(int k=0;k
Y[k]=0;
printf("Array elements of A= ");
for(int i=0;i
printf("\t");
for(int j=0;j
printf("%d ",A[i][j]);
}
printf(" ");
}
printf("Array elements of x= ");
for(int k=0;k
printf("\t%d ",X[k]);
printf("Array elements of Y= ");
for(int i=0; i
for(int j=0; j
Y[j]+=A[i][j]*X[j];
}
for(int k=0;k
printf("\tY[%d]=%d ",k+1,Y[k]);
return 1;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!