## Repeated printing of a specific elements-sparse matrix addition?

Hi! Here's my code for addition of two sparse matrices represented as a 3-tuple. The program adds up all elements in sparse matrices A and B and stores it in matrix C except that it repeats some elements. How should the code be modified?

Here's my code:
Code:
```#include<stdio.h>
#include<conio.h>

int main(void)
{
int a,b,c,i,j,k=1,count=0,m;

printf("Enter non zero elements of s matrix 1:");       //accept matrix A directly in the 3-tuple form
scanf("%d",&a);
printf("\nEnter matrix:");
for(i=0;i<=a;i++)
{
for(j=0;j<3;j++)
{
scanf("%d%",&a[i][j]);
}
}

printf("\nEnter non zero elements of s matrix 2:");   //accept matrix B directly in the 3-tuple form
scanf("%d",&b);
printf("\nEnter matrix:");
for(i=0;i<=b;i++)
{
for(j=0;j<3;j++)
{
scanf("%d%",&b[i][j]);
}
}

//init all  elements of matrix C to zero(required for the check made below at *)

for(i=0;i<20;i++)
{
for(j=0;j<3;j++)
{
c[i][j]=0;
}
}

//copy elements from matrices A and B with the same indices into the corresponding index of C

for(i=1;i<=a;i++)
{
if(a[i]==b[i] && a[i]==b[i])
{
c[k]=a[i];
c[k]=a[i];
c[k]=a[i]+b[i];
count++;
}
}

//copy uncommon elements from A to matrix C
for(i=1;i<=a;i++)
{
LOOP:if(c[k]==0)               //* CHECK c[k] if it has been modified. If it has, there will be some non zero value.
{                            //if c[k]=0, then there is no data in C at that location.So we may copy current element of A
//into C.. (same for matrix B below..)
c[k]=a[i];
c[k]=a[i];
c[k]=a[i];
count++;
k++;
continue;
}

else
{
k++;
goto LOOP;
}
}

//copy uncommon from B to matrix C
k=1;
for(i=1;i<=b;i++)
{
LOOP2:if(c[k]==0)             //* check c[k] if it has been modified. If it has, there will be some non zero value.
{
c[k]=b[i];
c[k]=b[i];
c[k]=b[i];
k++;
count++;
continue;
}

else
{
k++;
goto LOOP2;
}
}
c=count;
c=a;
c=a;

//print matrix C