Guest User

Untitled

a guest
Jun 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void ftriangle(int end){
  6.     int index = 0;
  7.     for(; index <= end; index++){
  8.         cout << "*";
  9.     }
  10.     cout << " ";
  11. }
  12.  
  13. void inv_ftriangle(int start){
  14.     int end = 0;
  15.     for(; start > end; start--){
  16.         cout << "*";
  17.     }
  18.     cout << " ";
  19. }
  20.  
  21. int main(){
  22.     int index;
  23.     int end = 20; // Change this to make a bigger/smaller triangle
  24.  
  25.     for(index = 0; index < end; index++){
  26.         ftriangle(index);
  27.         inv_ftriangle(end - index);
  28.         inv_ftriangle(end - index);
  29.         ftriangle(index);
  30.  
  31.         cout << endl;
  32.     }
  33.     cin.get();
  34.     cin.get();
  35.     return 0;
  36. }
Add Comment
Please, Sign In to add comment