Describe the term 'nested loop'.
Answers
Answered by
6
Nested for loop
A for loop inside another for loop is called nested for loop.
Syntax of Nested for loop
for (initialization; condition; increment/decrement)
{
statement(s);
for (initialization; condition; increment/decrement)
{
statement(s);
... ... ...
}
... ... ...
}
If you understand the concept then try to do some programs.
Try this -C program to print all the composite numbers from 2 to a certain number entered by user.
(A number is said to be composite if it has at least one factor other than 1 and itself).
HOPE HELPS.....THNX....
A for loop inside another for loop is called nested for loop.
Syntax of Nested for loop
for (initialization; condition; increment/decrement)
{
statement(s);
for (initialization; condition; increment/decrement)
{
statement(s);
... ... ...
}
... ... ...
}
If you understand the concept then try to do some programs.
Try this -C program to print all the composite numbers from 2 to a certain number entered by user.
(A number is said to be composite if it has at least one factor other than 1 and itself).
HOPE HELPS.....THNX....
Answered by
4
Hi. A loop inside another loop can be defined as nested loops. Hope it helps.
Similar questions