Advertisement

Summetion of 2 array


#include<stdio.h>
#include<conio.h>
void main()
{ clrscr();
  int a[3][3],i,j,b[3][3],c[50][50];
  printf("enter numbers for 3*3 array:\n");
  for(i=0;i<3;i++)
    { for(j=0;j<3;j++)
      {   scanf("%d",&a[i][j]);
                                                }
                      printf("\n");
                      }
      printf("enter numbers for 3*3 array:\n");
  for(i=0;i<3;i++)
    { for(j=0;j<3;j++)
      {   scanf("%d",&b[i][j]);
                                                }
                      printf("\n");
                      }

   printf("********output********\n");
   for(i=0;i<3;i++)
    { for(j=0;j<3;j++)
      {   printf("%d ",a[i][j]);
                                                }
                     printf("\n");
                      }
      printf("********output********\n");
   for(i=0;i<3;i++)
    { for(j=0;j<3;j++)
      {   printf("%d ",b[i][j]);
                                                }
                     printf("\n");
                      }
    printf("Summetion of 2 array=\n");
      for(i=0;i<3;i++)
    { for(j=0;j<3;j++)
       c[i][j]=a[i][j]+b[i][j];}

                for(i=0;i<3;i++)
  {    {       for(j=0;j<3;j++)

    printf("%d ",c[i][j]); }
   printf("\n");}
   getch();

                                    }

No comments:

Post a Comment

Please comment bellow. Share your knowledge