C++ Examples – C++ Program to print half Pyramid




cpp tutorials
cpp tutorials

A C++ program to print the half pyramid

#include <iostream>
using namespace std;
int main()
{
  int i,j,rows;
  cout<<"Enter the number of rows: ";
  cin>>rows;
  for(i=1;i<=rows;++i)
    {
      for(j=1;j<=i;++j)
        {
          cout<<"* ";
        }
      cout<<"\n";
    }
  return 0;
}

/*

OUTPUT:
Enter the number of rows: 5
*
* *
* * *
* * * *
* * * * *


*/

Different ways of Putting the above question

  • C++ Program To display the half pyramid of * stars numbers and character
  • C++ program to print patterns of numbers and stars
  • C++ Programming: half Pyramid
  • C++ – A program to print the half pyramid
  • C++ Program to print pyramid of stars *
  • C++ program to print half patterns of numbers and stars
  • C++ Tutorial – A Star half pyramid and String triangle using for loops
  • C++ Star Pyramid – C++ Forum
  • C++ program to print patterns, half pyramids of numbers and stars
  • C++ Programming: Reverse Star Pyramid
  • C++ Programming Source Code to Print Pyramid and Triangles
  • Program to print pyramid of stars
  • C++ Tutorial – A Star pyramid and String triangle using for loops
  • C++ Program to Print Star Pyramid Triangle, C++
  • C++ programs to print pyramid patterns
  • C++ Program to print star pattern pyramid
  • C++ Programming Code To Create Pyramid and Structure
  • Print pyramids and diamonds in C Language – C and C++

 

 


Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com





Be the first to comment

Leave a Reply

Your email address will not be published.


*