Skip to content

Instantly share code, notes, and snippets.

@0xDaksh
Last active July 12, 2017 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xDaksh/56765faa8596d52a7d2e846db3053bf4 to your computer and use it in GitHub Desktop.
Save 0xDaksh/56765faa8596d52a7d2e846db3053bf4 to your computer and use it in GitHub Desktop.
Star-Tree Reversed-Mirror-Edition :3
/*
Created on July 12th 2017 : 5:30:10
Created by Daksh Miglani.
*/
// for turbo cplusplus
#include <iostream.h>
#include <conio.h>
int main() {
int a;
cout<<"Please Let me know, the amount of rows you'd like"<<endl;
cin>>a;
for(int i = 0; i <= a; i++) {
for(int j = a-i; j >= 0; j--) {
cout<<" ";
}
for(int k = 0; k <= i-1; k++) {
cout<<"*";
}
cout<<endl;
}
getch();
}
// for XCode / CodeBlocks C++ => Version 14
#include <iostream>
using namespace std;
int main() {
int a;
cout<<"Please Let me know, the amount of rows you'd like"<<endl;
cin>>a;
for(int i = 0; i <= a; i++) {
for(int j = a-i; j >= 0; j--) {
cout<<" ";
}
for(int k = 0; k <= i-1; k++) {
cout<<"*";
}
cout<<endl;
}
return 0;
}
// Outputs -
Please Let me know, the amount of rows you'd like
3
*
**
***
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment