Search C Program | nimishsoft@gmail.com

Alphabet Pattern - 12

AAAAA
BBBB
CCC
DD
E


#include <stdio.h>

int main()
{
    int i, j;
    for(i=1;i<=5;i++)
    {
        for(j=5;j>=i;j--)
        {
            printf("%c",'A'-1 + i);
        }
        printf("\n");
    }

    return 0;
} 


6 comments:

  1. how to write this code using cout statements?

    ReplyDelete
  2. java eclipse example ples?

    ReplyDelete
  3. How to "\" in c if non-english keyboard is there?
    E.g. By this caret sign can be done

    ReplyDelete
  4. how to print this pattern
    if n=1 then
    *
    ***
    if n=2 then
    *
    ***
    *
    *
    *****
    and if n=3 then
    *
    ***
    *
    *
    *****
    *
    *
    *
    *******

    ReplyDelete
  5. What is the logic behind 'A'-1 + i??

    ReplyDelete