C/C++ Program to Print Following Pattern

ABCDEFGFEDCBA
ABCDEF  FEDCBA
ABCDE     EDCBA
ABCD         DCBA
ABC             CBA
AB                 BA
A                     A

C Program

C++ Program

C/C++ Program to Print Following Pattern ABCDEFGFEDCBA ABCDEF  FEDCBA ABCDE     EDCBA ABCD         DCBA ABC             CBA AB                 BA A                     A

Comment below if you find any difficulty in understanding the above programs.


3 thoughts on “C/C++ Program to Print Following Pattern

  1. R.Hari Krishnan

    We can use two loops for much easier executions….
    #include
    main ()
    {
    Int n,i,j,k;
    printf(“Enter the num/n”);
    scanf(“%d”,&n);
    for(i=0;i<=n,i++)
    for(j=-n;j<=n,j++)
    {
    k=j;
    if(k=i)
    printf(“%c”,ch-k);
    else
    printf(” “);
    }
    printf(“/n”);
    }

    Reply
  2. Manan Sharma

    #include
    #include

    int main()
    {
    int i,j,k;
    int space;
    int limit=71;

    for(i=0;i<=6;i++)
    {
    for(k=65;k<=limit;k++)
    printf("%c",k);
    space=i*2-1;
    for(j=1;j=65;k–)
    {
    if(k<=70)
    printf("%c",k);
    }
    printf("\n");
    limit–;
    }
    return 0;
    }

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *