write a program to diaplay a pyramid as shown:

The output is displayed as follows:


1

22

333

4444

55555




Select To use this code as it is.. select and copy paste this code into code.cpp file :)



  1. #include <iostream.h>
  2. #include <conio.h>
  3. void main()
  4. {
  5. clrscr();
  6. for (int i=1;i<=5;i++)
  7. {
  8. for(int j=1;j<=i;j++)
  9. cout<<i;
  10. cout<<"\n";
  11. }
  12. getch();
  13. }

Check out this stream