SYNTAX:-
for (initializing ; test condition ; increment / decrement)
{
statement;
for (initializing ; test condition ; increment / decrement)
{
body of inner loop;
}
statement;
}
PROGRAM
#include
void main ( )
{
int i, j;
clrscr ( );
for (j=1; j<=4; j++)
{
for (i=1; i<=5; i++)
{
printf (“*”)
}
printf (“\n”);
}
getch ( );
}
OUTPUT OF THIS PROGRAM IS
* * * *
* * * *
* * * *
* * * *
No comments:
Post a Comment