Pyramid Problem No. 22
Q.22 Write a C program to print the following character triangle:
A
B B
C C C
D D D DSolving in C:#include <stdio.h> int main(){ int row,col,count; for(row=1,count=65;row<=4;row++,count++){ for(col=1;col<=row;col++) printf("%c ",count); printf("\n"); } return 0; }
Comments
Post a Comment