Odds and Evens
in
Programming Questions
•
1 year ago
Hi everyone! New to processing and enjoying it alot but I have a little question.
I would like to do a program that would add all even numbers from 1 to 100.
this is what I have so far:
- for(int x=0;x<=100;x=x+1){
- if((x%2)<1){
- println(x);
- }
2+2=4
4+4=8
etc
what I really wanted is:
2+4+6+8+etc
is it possible?
Thanks in advanced :D
1