Sunday, December 25, 2011

C Language program on pattern


C Program on printing the following pattern

1AAAA
22BBB
333CC
4444D
55555

#include<stdio.h>
void main()
{
int i,j,k;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
for(k=i;k<5;k++)
{
printf("%c",(i+64));
}
printf("\n");
}
getch();
}

No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner