Skip to content

Commit

Permalink
Added 07-11-2024 Question
Browse files Browse the repository at this point in the history
Added 07-11-2024 Question
  • Loading branch information
madhurimarawat authored Nov 7, 2024
1 parent 9652507 commit 05813d2
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions 07-11-2024/Question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
### **Question: Pattern Printing Question**

**Difficulty Level:** 🟢 Beginner
**Domain:** Patterns and Loops

### **Objective:**

Given an integer input `n`, print the following pattern:

### **Problem Description:**

You need to create a program that prints a pattern based on the number of rows specified by the input `n`. The pattern should follow these rules:

- The first row has characters starting from `A` to `chr(65 + n - 1)` and then reverses back to `A`, with no spaces in between.
- Each subsequent row has increasing spaces in the middle, gradually replacing the characters, until only the first and last characters remain on the last row.

### **Input:**

- A single integer `n` (1 ≤ n ≤ 26), representing the number of rows to print.

### **Output:**

- A pattern printed as described.

### **Example:**

#### Input:

```plaintext
Enter Number of Rows: 5
```

#### Output:

```plaintext
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
```

### **Constraints:**

- The input `n` should be a positive integer between 1 and 26 (inclusive).

### **Note:**

Ensure that the pattern aligns properly, with spaces in the middle increasing by four spaces per row and the mirrored characters printed in reverse on the right-hand side.

0 comments on commit 05813d2

Please sign in to comment.