C program to print square spiral number pattern - asr

#include <stdio.h>
#include <conio.h>


void main(){
int i,j,a[10],n=3,big,k;
clrscr();
printf("enter three numbers\n ");


for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
     printf("\n");
for(i=1;i<=5;i++)
   {
    for(j=1;j<=5;j++)
      {
       i>1&&i<5&&j>1&&j<5?i==3&&j==3?
       printf("%d ",a[0]):
       printf("%d ",a[1]):
       printf("%d ",a[2]);
      }
   printf("\n");
}



getch();
}


  output:

Comments

Popular posts from this blog

aaabb to32 ,aabbb to a2b3 convert in c-asr

a2b3 output aabbb c program and beautiful use of getchar() ,isdigit() ,atoi() functions and stdlib.h header file-asr