the duty of this code is ... it should multiply 1 column array * 1 column array and display the result
i modified the last part of code but still doesn't give correct result
then, last part is wrong !
Code:
#include <cstdlib>#include <iostream>
#include<conio.h>
int main()
{
int m1[20],i,k,m2[20],mult[20],c1,c2,n;
printf("Enter 20 number for First matrix \n");
printf("\n");
for(i=0;i<3;i++)
{
scanf("%d",&m1[i]);
}
printf("You have entered the first matrix as follows:\n");
for(i=0;i<3;i++)
{
printf("%d\t",m1[i]);
printf("\n");
}
printf("Enter 20 numbers for Second matrix \n");
printf("\n");
for(i=0;i<3;i++)
{
scanf("%d",&m2[i]);
}
printf("You have entered the second matrix as follows:\n");
for(i=0;i<3;i++)
{
printf("%d\t",m2[i]);
printf("\n");
}
printf("Now we multiply both the above matrix \n");
printf("The result of the multiplication is as follows:\n");
mult[i]=0;
for(i;i<6;i++)
{
mult[i]=m1[i]*m2[i];
printf("%d\n",mult[i]);
}
printf("\n");
getch();
return 0;
}