How to find the Sum of Odd numbers within 100 by javascript
This article introduces you how to find the odd sum of javascript within 100, the content is very detailed, interested friends can refer to, hope to be helpful to you.
1. Use the for loop to control the range, traversing the number 1x 100.
2. Use the if statement to determine whether the number I is odd (whether I can be divisible by 2).
If it is odd, add sum+=i
So at the end of the for loop, you get an odd number and sum.
3. Output odd number and sum at last.
Example
Var sum = 0 for (var I = 1; I)