diff --git a/C++/Diamond.cpp b/C++/Diamond.cpp new file mode 100644 index 0000000..c33a5f9 --- /dev/null +++ b/C++/Diamond.cpp @@ -0,0 +1,27 @@ +#include +using namespace std; + int main() + {int i,j,r,k; + cout<<"Enter no. of rows u want to print: "; + cin>>r; + for(i=1;i<=r;i++) + { + for(j=1;j<=(r-i);j++) + + cout<<" "; + for(k=1;k<=i;k++) + {cout<<" * ";} + cout<<"\n"; + + } + for(i=1;i<=r;i++) + { + for(j=1;j<=(i);j++) + + cout<<" "; + for(k=1;k<=r-i;k++) + cout<<" * "; + cout<<"\n"; + } + return 0; + }