1 + 2 + 100 + 55 = 158
You don't. 1+1+1+1=4, not 100 and never will.
100 + 99 + 98 + 2 + 1 + 0.3 = 300.3
1 + 3/10 + 9/100 = 1 39/100 (that is, 1 and thirty-nine hundredths).
1+2+3+4.....+100 = 101*50= 5050
1,101 is.
for(int i=1; i<=100; ++i ) std::cout << i << std::endl;
5050
100
101
5,050
5050.