Possible Duplicate:
What limits the number of nested loops in c?
Hello.
When I read my C book, it says
Nesting for-Loop in C can continue even further up to 127 levels!
How does 127
come from?
My book doesn't mention about this. Just like a magic number to me.
[update]
int main()
{
int number, n, triangularNumber, counter;
triangularNumber = 0;
for (counter = 1; counter <= 5; ++counter){
printf("What triangular number do you want? \n");
// using a routine called scanf
scanf("%i", &number);
triangularNumber = 0;
for (n =1 ; n <= number; ++n)
triangularNumber += n;
printf("Triangular number %i is %i\n", number, triangularNumber);
}
return 0;
}