Bifalgorithm post
Incrementing a variable is just increasing the value of your variable by a specific number. So in this case, we like to increase the variable x by 5. So we would do x equals x plus 5. So this is saying that our variable x is going to equal to our variable x we had in line 2, which is 0 plus 5. So when printing out our variable x, we should get a value of 5. Another way of doing this is by using the plus equal. So x plus equals 5. This is the same thing as what is written in line 3. Just simplify. And you can use other math operators such as x minus equals 5 or x times equals 5 or any other math operators out there.
Incrementing a variable is just increasing the value of your variable by a specific number. So in this case, we like to increase the variable x by 5. So we wou…
Ideas in this flowchart
- Incrementing a Variable
- Definition
- Increase variable by specific number
- Example with x
- x = x + 5
- Initial value of x
- x = 0
- Result after increment
- x = 5
- Alternative method
- x += 5
- Equivalent to x = x + 5
- Other math operators
- x -= 5
- x *= 5