Printing a damru/dumbbell pattern
A program that prints a damru or dumb bell pattern of stars where a size unit is given in form of half of the damru height.
- Printing a filled damru/dumb bell pattern using adjustment of pre print spaces first in increasing order and then in decreasing order.
using namespace std;
for (j=1;j<=sp;j++) cout<<" ";
for (j=1;j<=2*(n-i)-1;j++) cout<<"*";
for (j=1;j<=sp; j++) cout<<" ";
for (j=1;j<=2*i-1;j++) cout<<"*";
Test it !
Test it !
Before using this you should have copied the code by selecting the entire code and pressing cntrl-c. (Line numbers will not come in the copied code). After that open any of the service and press cntrl-v to paste in the given code area. Needs a bit of tweaking as per the link.
Related codes are those codes where similar programming concepts are in use. They are different from alternate codes in the sense that they may not have same purpose and results.
Suggested Filename(s): damru.cpp
sunmitra| Created: 28-Jan-2018 | Updated: 28-Jan-2018|