Output will be
A
AB
ABC
ABCD
ABCDE
Code is :
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
for(int i=65; i<=69; i++)
//To make a bigger staircase , just increase max limit of i from 69 to what you need
{cout<<"\n";
for(char j=65; j<=i; j++)
cout<<j;
}
getch();
}
0 comments:
Post a Comment