Search
 
SCRIPT & CODE EXAMPLE
 

CPP

Program to print full pyramid using

#include <iostream>
using namespace std;

int main()
{
    int space, rows;

    cout <<"Enter number of rows: ";
    cin >> rows;

    for(int i = 1, k = 0; i <= rows; ++i, k = 0)
    {
        for(space = 1; space <= rows-i; ++space)
        {
            cout <<"  ";
        }

        while(k != 2*i-1)
        {
            cout << "* ";
            ++k;
        }
        cout << endl;
    }    
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: namespace file linking c++ 
Cpp :: statements 
Cpp :: c++ convert to assembly language 
Cpp :: c++ write to file in directory 
Cpp :: c++ - 
Cpp :: c++ define array with values 
Cpp :: C++ Nested if 
Cpp :: c++ sorting and keeping track of indexes 
Cpp :: c++ class methods 
Cpp :: minimum characters to make string palindrome 
Cpp :: create vector of specific size c++ 
Cpp :: and c++ 
Cpp :: tower of hanoi 
Cpp :: A Program to check if strings are rotations of each other or not 
Cpp :: how to modify 2d array in function c++ 
Cpp :: max and min function in c++ 
Cpp :: vector of vectors c++ 
Cpp :: char input in c++ 
Cpp :: Consell de forces polítiques de Catalunya 
Cpp :: even or odd program in c++ 
Cpp :: two dimensional array A[N,M] with the random numbers from 10 to 90. 
Cpp :: convert hex to decimal arduino 
Cpp :: log base 10 c+_+ 
Cpp :: how to code a game in c++ 
Cpp :: convert c++ to mips 
Cpp :: Z-function 
Cpp :: Operatore ternario c++ 
Cpp :: start google 
Cpp :: pagesNumbering C++ 
Cpp :: Imports the elements in the array c++ 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =