Skip to content

Instantly share code, notes, and snippets.

@nitishk72
Created August 9, 2017 17:04
Show Gist options
  • Save nitishk72/442d2ac52db1647576faccc01fedf002 to your computer and use it in GitHub Desktop.
Save nitishk72/442d2ac52db1647576faccc01fedf002 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int zz;
scanf("%d",&zz);
int array1[zz][zz] , array2[zz][zz];
printf("Enter value for Array 1 : \n");
for(int i= 0; i<zz;i++){
for(int j =0;j<zz;j++){
scanf("%d",&array1[i][j]);
}
}
printf("Enter value of array 2 : \n");
for(int i= 0; i<zz;i++){
for(int j =0;j<zz;j++){2
scanf("%d",&array2[i][j]);
}
}
system("cls");
printf("\t \t \t \t \t ");
for(int i =0;i<=8;i++){
printf("- - ");
}
printf("\n");
printf("\t \t \t \t \t ");
for(int i =0;i<=8;i++){
printf("- - ");
}
printf("\n");
printf(" \t \t \t \t \t Value of Array 1 :\n");
for(int k= 0; k<3;k++){
printf("\t \t \t \t \t ");
for(int l =0;l<3;l++){
printf("%d \t",(array1[k][l]));
}
printf("\n");
}
printf("\t \t \t \t \t ");
for(int i =0;i<=8;i++){
printf("- - ");
}
printf("\n");
printf("\t \t \t \t \t Value of Array 2 :\n");
for(int k= 0; k<3;k++){
printf("\t \t \t \t \t ");
for(int l =0;l<3;l++){
printf("%d \t",(array2[k][l]));
}
printf("\n");
}
printf("\t \t \t \t \t ");
for(int i =0;i<=8;i++){
printf("- - ");
}
printf("\n");
printf("\t \t \t \t \t ");
for(int i =0;i<=8;i++){
printf("- - ");
}
printf("\n");
printf("\t \t \t \t \t Difference of array 1 and array 2:\n");
for(int k= 0; k<3;k++){
printf("\t \t \t \t \t ");
for(int l =0;l<3;l++){
printf("%d \t",(array1[k][l] - array2[k][l]));
}
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment