#include<iostream.h>
#include<stdio.h>
void main()
{
clrscr();
char c;
int i,j;
c='A';
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
putchar(c);
}
putchar('\n');
fflush(stdout);
}
}
The output of this program will be:-
A
BB
CCC
DDDD
EEEEE
#include<stdio.h>
void main()
{
clrscr();
char c;
int i,j;
c='A';
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
putchar(c);
}
putchar('\n');
fflush(stdout);
}
}
The output of this program will be:-
A
BB
CCC
DDDD
EEEEE
No comments:
Post a Comment