Wednesday, September 30, 2009

Write programs to print alphabatical patterns using C

1) WAP to print the following pattern
A
A B
A B C
A B C D
prog:
#include"stdio.h"
#include"conio.h"
void main()
{
char i, j;
clrscr();
for(i='A'; i<='D'; i++)
{
for(j='A'; j<=i; j++)
{
printf("%c ", j);
}
printf("\n ");
}
getch();
}

No comments:

Post a Comment