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; }
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
+ 2
https://codescracker.com/cpp/program/cpp-program-print-diamond-pattern.htm