Translate

Labels

Thursday 23 January 2014

ALPHABET PATTERN_1

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: