Results for: m-k-harikumar

Write a program in C to generate a circular matrix?

#include <conio.h> #include <stdio.h> void main() { int a[16][16]; int c=1,i,j,k,m=0,n,x; clrscr(); printf("Enter the number of rows and columns for the square matrix \n"); scanf("%d",&n); x=n; while(n>=1) { for(k=0;k<n;k++) a[m][k+m]=c++; for(k=1;k<n;k++) a[k+m][n-1+m]=c++; for(k=n-2;k>=0;k--) a[n-1+m][k+m]=c++; for(k=n-2;k>0;k--) a[k+m][m]=c++; n=n-2; m=m+1; } for(i=0;i<x;i++)… Full Answer