hi,
iam trying to write a program using nested for loops which will display the following
*
**
***
****
*****
******
*******
********
|
Go4Expert Member
|
|
| 26May2010,23:34 | #2 |
|
what have you done so far ?
|
|
Mentor
|
![]() |
| 27May2010,12:24 | #3 |
|
This is very easy. Your subject line contains the key. A nested for loop is simply one loop inside another, e.g.:
Code:
for (int i=0; i<10; i++)
{
for (int j=0; j<10; j++)
{
printf("%d %d\n",i,j);
}
}
Then put that for loop into another for loop and vary N from 1 to the relevant maximum. It's as simple as that! |

