logoStarPatterns
Back to Patterns

Alphabet E Pattern

Pattern Result

*******
*
*
******
*
*
*******

Code Implementation

Explanation

The Alphabet E Pattern creates a shape that resembles the letter E using asterisks. The pattern consists of five parts: the top horizontal line, the top vertical part, the middle horizontal line, the bottom vertical part, and the bottom horizontal line. The algorithm ensures that n is odd to create a symmetrical E. The horizontal lines are created by filling all or a portion of the row with stars. The vertical parts are created by placing a star only at the first position, with spaces filling the rest of the row. This creates the distinctive shape of the letter E with three horizontal lines connected by a vertical line on the left.