void main()
{
int a[2][3],b[2][3],c[2][3];
int i,j;
clrscr();
printf("\nEnter the element in the array :: ");
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\nEnter the element in the second array :: ");
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&b[i][j]);
}
}
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
c[i][j]=a[i][j]+b[i][j];
}
}
clrscr();
printf("\n\n\nElements in the first array ::");
for(i=0;i<2;i++)
{
printf("\n\n\t\t\t");
for(j=0;j<3;j++)
{
printf("\t%d",a[i][j]);
}
}
printf("\n\n\nElements in the Second array ::");
for(i=0;i<2;i++)
{
printf("\n\n\t\t\t");
for(j=0;j<3;j++)
{
printf("\t%d",b[i][j]);
}
}
printf("\n\n\nElements in the Resultant array ::");
for(i=0;i<2;i++)
{
printf("\n\n\t\t\t");
for(j=0;j<3;j++)
{
printf("\t%d",c[i][j]);
}
}
getch();
}
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment