Could anyone give examples of an application that displays all even numbers from 2 to 100 inclusive , and that starts a new line after every multiple of 20 (20, 40, 60, 80).
Here is what i need to include in my assignment if anyone could talk it through with me, and explain why I need to use certain commands it would be greatly appreciated. Please try and make it simpler though since I am not that advanced.
1. For loop - 2 pt
2. If statement - 2 pt
3. Increment - 2 pt - efficient for what the output is
4. Newline after every multiple - 2
5. Make sure you put in your name, date and project - 2
For loop has 3 parts, initialization, condition, and increase.
Initialize to your starting value, go to your condition, and increase by your incrementing amount.
If statement will be determining if the variable is a multiple of 20. (Hint: Modulus division)