No j is not saved because you don't go back to the outer loop until the inner one is finished and each time you re-enter the inner loop it's starting over... the numerical printout from my example...
Type: Posts; User: CommonTater
No j is not saved because you don't go back to the outer loop until the inner one is finished and each time you re-enter the inner loop it's starting over... the numerical printout from my example...
Initialization is done only at the beginning of a for() loop... any for() loop, every for() loop...
You have two loops, one running inside the other...
Look at the way the numbers count up...
...
Here try this little code snippet...
#include <stdio.h>
int main (void)
{ int i, j;
for (i = 0; i < 5; i++)
for (j = 0; j< i; j++)
If you would learn to indent your code properly you would actually be able to see what is happening...
#include <stdio.h>
int binom(int n, int k)
{
int result=1;
int i;