Tuesday, March 13, 2012

Program to print star pattern in C++

#include <iostream>
using namespace std;

int main()
{
    int i,j;
   
    for(i=1; i<=5; i++)
    {
        cout << "\n";
       
        for(j=1; j<=i; j++)
        {
            cout << "*";
        }
    }
   
    return 0;
}


OUTPUT:
 

1 comment:

  1. How To Start with Pyramids and Star Pattern with C++
    http://geeksprogrammings.blogspot.com/2013/06/program-to-print-pyramids-on-screen.html
    http://geeksprogrammings.blogspot.com/2013/09/print-star-triangle.html

    ReplyDelete