Syntax:-
{
while(cond 2)------------------inner while
{
statements;
}
}
Note:-
1. First it checks the outer while condition.
2. It outer while condition.is true it again checks the inner while condition.
3. If inner while condition is true it executes the true statements of the inner while and goes inner while condition.
4. This process will be continuous until the specific inner while condition will be false.
5. If inner while condition will be false it goes to outer while condition.
6. If that condition is true repeats the same process.
7. This process will be continuous until the specified outer while condition is false.
Flow Chart:-
#include<stdio.h> #include<conio.h> void main() { int i,j; clrscr(); i=1; while(i<=10) { j=1; while(j<=10) { printf("%d*%d=%d\t",i,j,i*j); j++; } i++; } getch(); } |
Post a Comment