ASP.
NET LOOPING STATEMENTS - 10 MARK
NOTES
Introduction
Looping statements are used to execute a block of code repeatedly. They reduce code repetition
and make programs easier to understand and maintain.
For Loop
Used when the number of repetitions is known.
Example: Display numbers from 1 to 20 using a for loop.
While Loop
Checks the condition before executing the statements.
Do While Loop
Executes at least once before checking the condition.
Foreach Loop
Used to access values from arrays and collections.
Advantages
Reduces repetition, saves time, improves readability and simplifies data processing.