Nested Loops Print the Pattern
/* Exercise 4: Create the following pattern using nested for-loops: ########## ## ## # # # # # # # # # ## # # ## # # # # # # # # # ## ## ########## */ void Main() { for (int i = 0; i < 1; ++i) { for (int j = 0; j < 1; ++j) { Console.Write( @" ########## ## ## # # # # # # # # # ## # # ## # # # # # # # # # ## ## ##########"); } } }
A programming exercise asks for a hash-symbol pattern to be created using nested for-loops. The joke is that the loops are set to run only once, while the entire pattern is hard-coded as a multiline string, humorously defeating the purpose of the exercise.
- @ithueti / 165 2018-04-09
- @right_wing_dev_squads / 3310 2022-01-20
- Type
- image
- Size
- 447×640 · 26.0 KiB
- Mood
- sarcastic
- Language
- en
- Added