So I have to make it a full diamond , but I have a problem . How to give space from left side . Here's my code. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

So I have to make it a full diamond , but I have a problem . How to give space from left side . Here's my code.

#include <iostream> using namespace std; int main() { int i,j,a,b; for(i=1;i<=9;i++) { for(j=1;j<=i;j++) { cout<<"*"; } cout<<endl; } for(a=9;a>1;a--) { for(b=1;b<a;b++) { cout<<"*"; } cout<<endl; } return 0; }

27th Dec 2017, 9:30 AM
Abhishek
Abhishek - avatar
2 Answers
+ 10
Draw a bunch of right angle triangles. here is something I used in another project. I hope this helps in your understanding. https://code.sololearn.com/c2se3U1eNW3J/?ref=app
27th Dec 2017, 9:48 AM
jay
jay - avatar
+ 2
https://codescracker.com/cpp/program/cpp-program-print-diamond-pattern.htm
27th Dec 2017, 9:52 AM
emmey
emmey - avatar