For Loop
The for loop is frequently used, when a loop is to run for a fixed number of time.
Syntax
for (initialization; test-condition; increment/decrement)
{
block of statements;
}
Sample program
Output
Nested For Loop
When a statement block of a for-loop lies completely inside the block of a new for-loop then, it is called Nested for loop.
Syntax
Sample Program
Output
Break and Continue Statement.
Break Statement is used to stop any loop or switch Statement at any time.
Sample Program
Output
Continue Statement
This statement is used to skip the repetition of a loop.
Sample Program
Output
PHP Fundamental Tutorials with Basic Demo by Chentan in 2020 – Part-1
PHP Fundamental Tutorials with Basic Demo by Chentan in 2020 – Part-2
Latest posts by Sushant Kumar (see all)
- What is On-Page Optimization and Off-page Optimization - March 14, 2024
- [SOLVED] Flutter : PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null) - December 7, 2021
- [Solved] Flutter : Error: The getter ‘subhead’ isn’t defined for the class ‘TextTheme’ from package:flutter/src/material/text_theme.dart’ – searchable_dropdown - December 6, 2021