Printing my name!

  • Source Code:

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

main()
{
int i,row,j,m;char c=’-‘;
scanf(“%d”,&row);

system(“color 6”); printf(“\n\n\n”); for(i=2*row;i>row;i–)
{for(j=1;j<row+2;j++)
printf(” “);

for(j=row+1;j<(2*row);j++)
{if(j==i)
printf(“*”);
else
printf(” “);
}

for(j=2*row;j>row;j–)
{if(j==i)
printf(“*”);
else
printf(” “);
}
printf(“\n”);
}for(m=1;m<row+1;m++)
printf(” “);
if(m==row+1)
printf(“*”);
for(m=(3*row/2)+2;m>=1;m–)
{

printf(“%c”,c);}
if(m=3*row+2)
printf(“*”);
printf(“\n”);

for(i=row;i>=1;i–)
{

for(j=1;j<=(row);j++)
{if(j==i)
printf(“*”,j);
else
printf(” “);
}
for(j=2*row;j<=4*row;j++)
printf(” “);
for(j=row;j>=1;j–)
{if(j==i)
printf(“*”,j);
else
printf(” “);
}
for(j=row+1;j>=1;j–)
{if(j==i)
printf(” *”,j);
else
printf(” “);
}
for(j=1;j<=row;j++)
{if(j==i)
printf(” *”,j);
else
printf(” “);
}
printf(” X”);
printf(“\n”);
}
printf(“\n\n\n\n\n\n\n\n\n\n\n”);
return 0;
}

  • Output

Avi C

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s