Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void ftriangle(int end){
- int index = 0;
- for(; index <= end; index++){
- cout << "*";
- }
- cout << " ";
- }
- void inv_ftriangle(int start){
- int end = 0;
- for(; start > end; start--){
- cout << "*";
- }
- cout << " ";
- }
- int main(){
- int index;
- int end = 20; // Change this to make a bigger/smaller triangle
- for(index = 0; index < end; index++){
- ftriangle(index);
- inv_ftriangle(end - index);
- inv_ftriangle(end - index);
- ftriangle(index);
- cout << endl;
- }
- cin.get();
- cin.get();
- return 0;
- }
Add Comment
Please, Sign In to add comment