Posts

Showing posts with the label Star Pattern Questions

Star pattern 4

Image
  # include < iostream > using namespace std ; int space ; int row = 5 ; int main (){     for ( int i = 1 ; i <= 5 ; i ++ ){         for ( space = 1 ; space <= ( row - i ); space ++ )         {             cout << " " ;         }         for ( int j = 1 ; j <= i ; j ++ )         {             cout << " * " ; // add some space just after star         }         cout << " \n " ;     }     return 0 ;     }