Thursday, April 18, 2013

C++ program to print 5 rows of 10 stars


Simple star pattern programs in c++





#include <iostream>
using namespace std;

const int STARS_PER_LINE = 10;
const int NUM_LINES      = 5;

int main()
{
   int stars_printed, lines_printed;
   lines_printed = 0;
   while ( lines_printed < NUM_LINES )
   {
      stars_printed = 0;
      while ( stars_printed < STARS_PER_LINE )
      {
  cout << '*';
  stars_printed++;
      }
      cout << endl;
      lines_printed++;
   }
   return 0;
}


OUTPUT:
**********
**********
**********
**********
**********



---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
-------------------------------------------

Program to print various types of stars/patterns
C++ Program to print patterns of numbers and stars
C++ Program To Print Square Of Stars
Simple star pattern programs in c++

2 comments:

  1. You are a very skilled blogger. I have joined your feed and look forward to seeking more of your excellent post.

    www.n8fan.net

    ReplyDelete
  2. Thanks to the writer of this article. I appreciate your effort in making this informational blogs. I know it's not easy to do this but you have done a really great job. Congrats. I'm pretty sure your readers enjoying it a lots.


    Rica
    www.imarksweb.org

    ReplyDelete