Pattern Program T-01

C

#include <stdio.h>
int main()
{
	int i,j,p;

	int n=5;
	
	for(i=0;i<n;i++)
	{
      p = 0;
	 for(j=0;j<n;j++)
	 {
	   if(i==j || (i+j == n-1) || ((i==0 || i == n-1)  && j == n/2))
	   {  printf("%c ",p+65);
	     p++;
	   }
	   else
       {
		 printf("  ");//two ws
       }
	 }
     printf("\n");
	}
	return 0;
}

C++

Java

C#

Python

5 2 votes
Rate this Program
Subscribe
Notify of
guest


0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments