#include <stdio.h>
int main() {
int a[3][3],i,j;
printf("enter the elements\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&a[i][j]);
}
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%d",a[i][j]);
}
printf("\n");
}
printf("rotated matrix by 180 degree is\n");
for(i=2;i>=0;i--)
{
for(j=2;j>=0;j--)
{
printf("%d",a[i][j]);
}
printf("\n");
}
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: