#include<stdio.h>
#include<conio.h>
main()
{
int i,j,n;
printf("Enter the size of row = column
of the matrix\n");
scanf("%d",&n);
int A[n][n],B[n][n];
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
printf("Enter a number for A[%d][%d] = ",i+1,j+1);
scanf("%d",&A[i][j]);
}
}
printf("\nThe matrix A is : \n");
for(i=0;i<n;i++)
{
printf("\n");
for(j=0;j<n;j++)
{
printf("%d\t",A[i][j]);
}
}
for(i=0;i<n;i++)
{
printf("\n");
for(j=0;j<n;j++)
{
B[i][j]=A[i][j]*A[i][j];
}
}
printf("\nThe Multiplication of
the matrix A is : \n");
for(i=0;i<n;i++)
{
printf("\n");
for(j=0;j<n;j++)
{
printf("%d\t",B[i][j]);
}
}
printf("\n\n");
getch();
}
No comments:
Post a Comment