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++
IT Certification Category (English)640x480

Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com


Top Online Courses From ProgrammingKnowledge

Python Course http://bit.ly/2vsuMaS
Java Coursehttp://bit.ly/2GEfQMf
Bash Coursehttp://bit.ly/2DBVF0C
Linux Coursehttp://bit.ly/2IXuil0
C Course http://bit.ly/2GQCiD1
C++ Coursehttp://bit.ly/2V4oEVJ
PHP Coursehttp://bit.ly/2XP71WH
Android Coursehttp://bit.ly/2UHih5H
C# Coursehttp://bit.ly/2Vr7HEl
JavaFx Coursehttp://bit.ly/2XMvZWA
NodeJs Coursehttp://bit.ly/2GPg7gA
Jenkins Course http://bit.ly/2Wd4l4W
Scala Coursehttp://bit.ly/2PysyA4
Bootstrap Coursehttp://bit.ly/2DFQ2yC
MongoDB Coursehttp://bit.ly/2LaCJfP
QT C++ GUI Coursehttp://bit.ly/2vwqHSZ