A C program to print the following alphabet pattern
A
AB
ABC
ABCD
ABCDE
main(){
int i,j,n;
clrscr();
printf("Enter the number of rows:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%c",'A'+j-1);
}
printf("\n");
}
getch();
}
No comments:
Post a Comment