Name: t work 2010-11-13 11:19
What's wrong with this shit? It's supposed to multiply every line seperatly for example we have the array
123
456
789
it's supposed to do this: 1*2*3=6 ; 4*5*6=120; 7*8*9=504;
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int mas1[2][3]={{1,2,3},{4,5,6},{7,8,9}};
int mas[100];
int i,j,m,n,k;
j=0;
i=0;
m=2;
n=3;
for(k=0;k<=m;k++)
{
mas[k]= mas1[i][j] * mas1[i][j+1] * mas1[i][j+2];
i++;
printf("%d",mas[k],",\t");
}
system("PAUSE");
return 0;
}
123
456
789
it's supposed to do this: 1*2*3=6 ; 4*5*6=120; 7*8*9=504;
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int mas1[2][3]={{1,2,3},{4,5,6},{7,8,9}};
int mas[100];
int i,j,m,n,k;
j=0;
i=0;
m=2;
n=3;
for(k=0;k<=m;k++)
{
mas[k]= mas1[i][j] * mas1[i][j+1] * mas1[i][j+2];
i++;
printf("%d",mas[k],",\t");
}
system("PAUSE");
return 0;
}