fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int e=1;
  7. for (int a=1; a<=5; a++)
  8. {
  9. for (int b=4; b>=a; b--)
  10. {
  11. cout<<" ";
  12. }
  13. for (int c=0; c<e;c++)
  14. {
  15. cout<<"*"; // Printing Space Here
  16. }
  17. cout<<endl; // new line
  18. e=e+2;
  19. }
  20. }
  21.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
    *
   ***
  *****
 *******
*********