Commit 8b87f7a
committed
feat: Demonstrate use of enhanced for loop with String and char arrays
🧠 Logic:
- Create a `String` array `seasons` containing the four seasons.
- Use an enhanced for loop (for-each) to iterate over the `seasons` array and print each season.
- Define a `char` array `cardinalPoints` containing directional initials.
- Use another enhanced for loop to print each direction character.
- Emphasize the difference between characters (`'W'`) and strings (`"W"`).
Signed-off-by: Somesh diwan <[email protected]>1 parent a2c19bc commit 8b87f7a
1 file changed
+3
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
| 1 | + | |
| 2 | + | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | | - | |
| 12 | + | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
0 commit comments