Skip to content

Instantly share code, notes, and snippets.

@0xDaksh
Last active Jul 12, 2017
Embed
What would you like to do?
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