Pyramid Program (ABCDEFGFEDCBA)

 Hey, We are going to form this pattern by :

CODE:

#include<stdio.h>
int main(){

int i,s,get=0;
char start='F',end='G',one,two;

for (i=1;i<=7;i++)
{
for (one='A';one<=end;one++)
{
printf("%c",one);
}
for (s=1;s<=get;s++)
{
printf(" ");
}
for (two=start;two>='A';two--)
{
printf("%c",two);
}

printf("\n");
end--;
start=end;
get++;
if (get%2==0)
get++;
}

getchar();
return 0;
}

OUTPUT:


NEED WORK PRODUCE WORK

My name is Abdul Rehman I am from Pakistan. I am doing BS in Computer and information sciences. Currently, I am creating these blogs to help students of computer sciences all over the world..

1 Comments

  1. Big Fan As You Know I Have no words How to describe this.

    ReplyDelete
Post a Comment
Previous Post Next Post