#include
#include
// Note: The code is not very good !!!! But, OK for understanding the concept
// of matrix addition using pointers !!!!!
void main ()
{
int data[2][2], data1[2][2];
int *p1,*p2,i,j;
clrscr();
for (i = 0; i <2;i++)
{
for(j=0;j<2;j++)
{
data[i][j] = i+j;
data1[i][j]= i+ 2*j;
}
}
p1 = data[0];
p2 = data1[0];
for (i = 0; i<2;i++)
{
for(j=0;j<2;j++)
{
printf ("data -- %d\t",p1[i]);
}
printf("\n");
}
for (i = 0; i<2;i++)
{
for(j=0;j<2;j++)
{
printf ("data1 -- %d\t",p2[i]);
}
printf("\n");
}
for (i = 0; i <2;i++)
{
for(j=0;j<2;j++)
{
printf ("Sum %d\t",p1[i]+p2[i]);
}
printf("\n");
}
getch();
}
#include<stdio.h>
#include<stdlib.h>
int** addMatrices(int**,int**,int,int);
int main()
{
int **a;int **a1;int **a2;
int i,j,m,n;
printf("Enter the number of rows and columns\n");
scanf("%d",&m);
scanf("%d",&n);
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
a2=addMatrices(**a,**a1,m,n);
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
printf("%d",a2[i][j]);
}
printf("\n");
}
return 0;
}
int** addMatrices(int** a,int** a1,int m,int n)
{
int **l;int **k;int **q;
int r,s,i,j;
for(i=0;i<r;i++)
{
for(j=0;j<s;j++)
{
q[i][j]=l[i][j]+k[i][j];
}
}
return q;
}
this is immpossible
You can make use of pointers to achieve this.void add( int *a, int *b){(*a) += (*b);}Now if two numbers a and b are given and you need to store the value in variable c, then you would perform:c = a;add(&c,&b);
I fixed the problem by deleted the program 'Spyware Doctor' using the add or remove program Icon in Control Panel. Once I rebooted the computer, the problem was gone.
Suppose you want to add 11 and 12.instruction are : mvi a,11h mvi b ,12h mov d,b add b
Not possible. Let's not forget than in C the followings are all operators:+, -+=, -=++, --=&, *, []function-call
Use the Array Package. if you need help - add me on msn james_mc_123@hot dkjdkdjd mail.comp
No.
write ashell script to add awo matrix using array.
You can make use of pointers to achieve this.void add( int *a, int *b){(*a) += (*b);}Now if two numbers a and b are given and you need to store the value in variable c, then you would perform:c = a;add(&c,&b);
They must have the same dimensions.
The usual rules of addition of fractions apply.
adding the additive identity matrix does not change the original matrix
You add matrices by adding their respective terms - e.g. the element in the first row and sixth column of the sum is the sum of the elements in the addends' first rows and sixth columns. Wikipedia has a nice example of matrix addition that I linked below.
Using a photo editing program such as photo shop, you add something called a "watermark"
GOUDHMARINI
No. You can only add matrices of the same size.
No, you cannot add matricies of different dimention/order (i.e. different number of rows or columns)
It depends on what program you are using. Usually there is a File > Import option at the top left of the screen. Try using the program's Help Center option if this does not work.