If you add all the numbers from 1 to 98, the total is 4851.
303
100 + 99 + 98 + 2 + 1 + 0.3 = 300.3
if (n%2==0) sum=n/2*(n+1); else sum=(n+1)/2*n;
Sum = 79*(79+1)/2 = 79*80/2 = 3160
Sum of numbers from 1 to 100:(1+100) + (2+99) + (3+98) + (4+97) + ... + (49+52) + (50+51) =50 pairs, each pair adds up to 101= (50 x 101)= 5,050
2
2
1+2+4 = 7
The sum of the numbers given is 31. 1 + 2 + 4 + 8 + ... + 2n = 2n+1 - 1
You add 1 plus another one and you get 2
The sum of -1 and -1 is -2.
3