Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions DAY49/Pattern
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

#include <stdio.h>

int main()
{
int i,j;
char CH='E';
int space=1;

/*loop for row*/
for(i=1; i<=5; i++)
{
/*first part of the row*/
for(j='A'; j<=CH; j++)
printf("%c",j);

/*remove last character of first part of first row*/
if(i==1)
printf("\b");

/*spaces between first, second part of the row*/
for(j=1; j<space; j++)
printf(" ");

/*second part of the row*/
for(j=CH; j>='A'; j--)
printf("%c",j);

printf("\n");
CH--;
space++;
}

return 0;
}