[Solved] Formatting php for-loop

Because of this: $i=($num_dates-1) You need to check the condition ==, not use an assignment =. Although in this case it appears you want to do something like this: $i <= ($num_dates-1). You may have just forgot to type <. 1 solved Formatting php for-loop

[Solved] Find the Average marks for each student

You’re not “zeroing out” your total counter when moving on to the next average computation. This is a trivial problem that you would be able to solve if stepping through the code line by line. If you don’t practice this now, it’ll be incredibly difficult to solve more complex problems. Next question you ask, please … Read more

[Solved] Is there some reason for this kind of for-loop?

As long as you’re bothered with the for loop syntax, for ( ; lastheight < height ; lastheight++) is perfectly valid, as long as lastheight is defined and initialized previously. Quoting C11, chapter ยง6.8.5.3 for ( clause-1 ; expression-2 ; expression-3 ) statement […] Both clause-1 and expression-3 can be omitted. An omitted expression-2 is … Read more

[Solved] I don’t know how to use for loop

Your question is not really specific. Basically both for loops you are mentioning are doing the same thing. for i in range(10): print(i) gives back 1 2 … 9 the same is achieved by [print(i) for i in range(10)] This is preferred if you have a very short loop and you want your code to … Read more

[Solved] I need of help in found one solution on problem, React,Firebase,For Loop [closed]

You should use the callback in setState if you want to do that because it is async. Please refer to the following link to get more info: https://reactjs.org/docs/react-component.html#setstate Another alternative is to set the state only once instead of doing it multiple times. You don’t need to put all that info in the state only … Read more