/* C Program to print half pyramid using Alphabets */
#include <stdio.h>
int main()
{
int i, j;
char input, alphabet = 'a';
printf("Enter the lowercase character you want to print in last row: ");
scanf("%c",&input);
for(i=1; i <= (input-'a'+1); ++i)
{
for(j=1;j<=i;++j)
{
printf("%c", alphabet);
}
++alphabet;
printf("\n");
}
return 0;
}
Output:-
C Program To Print Half Pyramid Using Alphabets. |
No comments:
Post a Comment