write a program to diaplay a pyramid as shown:

The following output is displayed:

1

12

123

1234

12345




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<<j;
  10. cout<<"\n";
  11. }
  12. getch();
  13. }

Check out this stream