Last active
July 12, 2017 14:44
-
-
Save 0xDaksh/56765faa8596d52a7d2e846db3053bf4 to your computer and use it in GitHub Desktop.
Star-Tree Reversed-Mirror-Edition :3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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