Nesting of while Loop
Nesting of while loop को मतलब एक while loop के अंदर दूसरा while loop.
Syntax :
Program to print this pattern of numbers
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
Output :
NEXT : do - while loop
PREVIOUS : while loop
Nesting of while loop को मतलब एक while loop के अंदर दूसरा while loop.
Syntax :
Program to print this pattern of numbers
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
#include<stdio.h>
#include<conio.h>
int main(void)
{
int i,j;
clrscr();
i=1;j=1;
while(i<=5)
{
while(j<=5;)
{
printf("%d ", j);
j++;
}
i++;
printf"\n");
}
getch();
return 0;
}
int main(void)
{
int i,j;
clrscr();
i=1;j=1;
while(i<=5)
{
while(j<=5;)
{
printf("%d ", j);
j++;
}
i++;
printf"\n");
}
getch();
return 0;
}
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
NEXT : do - while loop
PREVIOUS : while loop
No comments:
Post a Comment