Good morning,
I'm starting very little in C, trying to learn well from the base. I've been thinking about a simple script for too long, since I do not quite understand why its output, which is the following:
*
**
***
****
*****
The script is this:
int main() {
int i, j;
for (i=0; i<5; i++) {
for(j=0; j<=i; j++){
printf("*");
}
printf("\n");
}
}
I can not understand why from the second iteration the values of j
e i
move away, when in both cases the increment is +1 for both i and j.
Surely it will be the dumbest questions that have been raised by these forums, but really that no matter how many laps I give, I do not understand X)
Greetings and thanks!