You did not explain what you excpect and what you get. Anyway...
1. What is the aim of continue_flag
? I don't see a reason for that. Remove it.
2. Sum of 1 up to xyz: Ok starting with zero is not critical because adding 0 does not change anything. But for nitpickers like me, starting from 1 is the right way.
3. up to 100
anything 'less than' ('<') 100 does not include 100. Therefore <= 100 is most probably your problem
I hope it helps.
[Edit]
Strange: I do not find a english version of Gaußsche Summenformel – Wikipedia[^]
[Edit 1]
After updating your question, my answer looks to be useless....
[Edit 2]
Simply do something like this
sum= 0;
count= 1;
while (count <= 100)
sum+= count;
count+= 1;
// After the above, sum should have the value you expect