C Code Snippet to Print Swastik Symbol

Print Swastik symbol in C
#include<stdio.h>
#include<conio.h>
void main()
{
char s[10][10];
int i,j;
clrscr();
for(i=0;i<9;i++)
{
for(j=0;j<9;j++)
{
s[i][j]='*';
}
}
for(i=0;i<4;i++)
{
for(j=1;j<4;j++)
{
s[i][j]=' ';
}
}
for(i=1;i<4;i++)
{
for(j=5;j<9;j++)
{
s[i][j]=' ';
}
}
for(i=5;i<8;i++)
{
for(j=0;j<4;j++)
{
s[i][j]=' ';
}
}
for(i=5;i<9;i++)
{
for(j=5;j<8;j++)
{
s[i][j]=' ';
}
}
for(i=0;i<9;i++)
{
for(j=0;j<9;j++)
{
printf("%c ",s[i][j]);
}
printf("\n");
}
getch();
}

Comments

  1. nice but can you tell me how to make it with cout command removing the char

    ReplyDelete
  2. its right....###print swastika in middle of the screen (input must be odd and grater than 4)....please tell me program in c language

    ReplyDelete

Post a Comment