Monday, 8 February 2016

C++ Shape pattern no 44

Leave a Comment
Questions:

C++ Shape pattern no 44

Explanation:

This problem is simple and just demonstration of nested loop.  Below mention code is compiled in Visual Studio 2015 and output snap is attached.. If any problem you feel and want explanation feel free to contact.

Code:

/**************************************************|
/*************C++ Programs And Projects************|
***************************************************/
#include<iostream>
using namespace std;
void main()
{
       int i, j;
       for (i = 0; i < 5; i++) {
              for (j = 0; j < 3 * i - 2; j++) {
                     cout << "*";
              }
              cout << endl;
       }
}



Output:
C++ Shape pattern no 44


Related Articles:

C++ Shapes Code

If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: