#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main(int argc, char *argv[])
{
int i,j,c,r,r1,row,row1;
int st[9],st1[9],st2[9];
FILE *f = fopen(argv[1], "r");
FILE *f1=fopen(argv[2],"r");
r=9;
r1=9;
/*initialize array*/
for(i=0;i<r;i++)
{
st[i]='\0';
}
for(i=0;i<r1;i++)
{
st1[i]='\0';
}
/*storing values in array from file*/
for(i=0;i<r;i++)
{
fscanf(f,"%d",&st[i]);
}
for(i=0;i<r1;i++)
{
fscanf(f1,"%d",&st1[i]);
}
row=(sizeof(st)/sizeof(int));
row1=(sizeof(st1)/sizeof(int));
for(i=0;i<r;i++)
{
if((st[i]=='\0')||(st1[i]=='\0'))
{
printf("Invalid matrix dimension\n");
exit(0);
}
}
/*printing input matrix*/
printf("Input Matrix1:\n");
for(i=0;i<r;i++)
{
printf("%d\t", st[i]);
}
printf("\n");
printf("Input Matrix2:\n");
for(i=0;i<r1;i++)
{

printf("%d\t", st1[i]);
}
printf("\n");
/*printing output matrix*/
printf("Output Matrix:\n");
for(i=0;i<r;i++)
{
st2[i]=st[i]+st1[i];
printf("%d\t", st2[i]);
}
printf("\n");
fclose(f);
fclose(f1);
return 0;
}