0
find the sum of even and odd number btw all the numbers 255 to 455
explain
2 Answers
+ 17
â initialize 2 int variables oddSum & evenSum with 0 [for sum of even & odd numbers]
â make a loop from a=255 to a=455 [range of numbers]
â inside loop, make use of if() condition to identify even numbers & other numbers will be odd
â if(i%2==0) { evenSum +=i;}
else {oddSum +=i;}
//it is enough information to make this program easilyđ
+ 7
Please try to code this first or at least give us an idea of how you intend to answer the problem.