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.

2 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

Leave a Reply

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