Another way to approach these questions is to start on either end of the range and work your way to the middle.
1) Sum of all even numbers from 1 to 199
Consider the first even number greater then 1 and first even number smaller then 199, so 2 + 198 =200
Then the second even number greater then 1 and second even number smaller then 199, so 4 + 196 =200
Doing the same for each even number or rather multiple of 2, we can continue till 98 + 102 =200.
As we know there will be 98/2 such pairs, the sum must equal (98/2)*200.
BUT we also need to remember that there is one even number with no pair, that is 100, so we add this to the above to arrive at sum = ((98/2)*200)+100 = 9900
2) Sum of all odd number from 100 to 300
Again smallest odd and largest odd in this range 101+299=400, 103+297=400 ... 199 + 201=400
number of such pairs: 50, and in this case unpaired is 0, so we can get the sum by 400*50=20000
In summary, first figure out the sum of the pair, and the number of times these pairs repeat. And finally account for any unpaired integer within the specified range.