Character Triangle Shape C Program

Q. How to design a character triangle shape C program as:



/*Character Triangle Shape C Program*/
int main()

 int n=1;
 char r,c,ch;
 printf("Entery any character : ");
 scanf("%c", &ch);
 if(ch>='a' && ch<='z')
 for(r='A'; r<=ch; r++,n++)
    for(c='A'; c<=ch-n+1; c++)
        printf("%c", c);
 return 0;

The output of above program would be:

Output of Character Triangle Shape C Program
Figure: Screen shot for Character Triangle Shape C Program

You might also like related programs:

  1. Big 98+ C Pyramid programs list
  2. Latest user asking pyramid programs list

No comments:

Post a Comment