Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ triangle

#include <iostream>
using namespace std;

int main()
{
    int rows;

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

    for(int i = 1; i <= rows; ++i)
    {
        for(int j = 1; j <= i; ++j)
        {
            cout << "* ";
        }
        cout << "
";
    }
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: macro c++ 
Cpp :: convert string to number c++ 
Cpp :: cout was not declared in this scope 
Cpp :: convert string to stream c++ 
Cpp :: c++ type of a variable 
Cpp :: how to write a hello world program in c++ 
Cpp :: how to hide the c++ console 
Cpp :: iterate vector from end to begin 
Cpp :: C++ mutex lock/unlock 
Cpp :: loop through char in string c++ 
Cpp :: integer type validation c++ 
Cpp :: convert int to string c++ 
Cpp :: online cpp to exe converter 
Cpp :: g++ optimization flags 
Cpp :: c++ get time 
Cpp :: how to run a msi file raspbrain 
Cpp :: roscpp publish int32 
Cpp :: c++ declare variable 
Cpp :: cpp unions 
Cpp :: iterate over map c++17 
Cpp :: how print fload wiht 2 decimal in c++ 
Cpp :: const char to string 
Cpp :: cpp init multidimensional vector 
Cpp :: how to store pair in min heap in c++ 
Cpp :: convert integer to string c++ 
Cpp :: c++ template function 
Cpp :: calloc c++ 
Cpp :: c++ loop vector 
Cpp :: c++ cstring to string 
Cpp :: cpp string slice 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =