//Program to display
A
A B
A B C
A B C D
#include<stdio.h>
void main()
{
char s;
int a=65, n, i, j;
clrscr();
printf(" Enter any number:");
scanf("%d", &n);
for( i=0; i< n ; i++ )\
{
for( j=0; j<=i ; j++)
{
s=a+j;
printf("%c",s,"\t");
}
printf("\n");
}
getch();
}
Output:
Enter any number:4
A
A B
A B C
A B C D
A
A B
A B C
A B C D
#include<stdio.h>
void main()
{
char s;
int a=65, n, i, j;
clrscr();
printf(" Enter any number:");
scanf("%d", &n);
for( i=0; i< n ; i++ )\
{
for( j=0; j<=i ; j++)
{
s=a+j;
printf("%c",s,"\t");
}
printf("\n");
}
getch();
}
Output:
Enter any number:4
A
A B
A B C
A B C D
No comments:
Post a Comment