Thread: [ c++] Pyramid Shape By me

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

    [ c++] Pyramid Shape By me

    [ c++] Pyramid Shape By me

    For beginner

    [ c++]  Pyramid Shape By me-60763_10151402713497845_153023960_n-jpg


    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 06: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, 05:14 PM