[ c++] Pyramid Shape By me

This is a discussion on [ c++] Pyramid Shape By me within the C++ Programming forums, part of the General Programming Boards category; [ c++] Pyramid Shape By me For beginner Code: #include<iostream.h> void main () { int h,i,j,k=0; h=8; for(i=1;i<=h;i++) { for(j=1;j<=h-i;j++) ...

  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    3

    [ c++] Pyramid Shape By me

    [ c++] Pyramid Shape By me

    For beginner

    Name:  60763_10151402713497845_153023960_n.jpg
Views: 769
Size:  33.9 KB


    Code:
     #include<iostream.h>
     void main ()
     {
     
         int h,i,j,k=0; h=8;
          
         for(i=1;i<=h;i++)
         {
             for(j=1;j<=h-i;j++)
             {
      cout<<" ";
             }
                                        
             for(j=1;j<=i+k;j++)
             {
      cout << "*";
             }                
             cout<<endl;
             k+=1;
         }
     }
    Last edited by Ibraheem Salem; 12-18-2012 at 05:53 PM. Reason: attch img

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how make this all pyramid in c++ 4.5
    By shah18 in forum C Programming
    Replies: 5
    Last Post: 10-04-2010, 11:34 AM
  2. Star Pyramid
    By subhadeepgayen in forum C Programming
    Replies: 2
    Last Post: 08-10-2010, 05:16 AM
  3. Number pyramid
    By Tehy in forum C Programming
    Replies: 7
    Last Post: 05-31-2007, 09:01 AM
  4. Making a pyramid of Xs
    By Tride in forum C++ Programming
    Replies: 8
    Last Post: 12-12-2003, 04:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21