Problem
Write a program to generate the following pattern on screen.A
A B
A B C
A B C D
A B C D E
A B C D E F
Solution - Code
#include<stdio.h>int main()
{
int i,j;
for(i=1;i<=6;i++)
{
char ch='A';
for(j=1;j<=i;j++)
{
printf("%c",ch);
ch++;
}
printf("\n");
}
system("pause");
return 0;
}
No comments :
Post a Comment
Note: Only a member of this blog may post a comment.