This program calculate the sum from 1 to 100 using do-while loop.
#include <iostream> using namespace std; int main() { int i, sum; sum = 0; i = 1; do { sum = sum + i; i = i + 1; } while (i <= 100); cout << "Result: " << sum; cin.get(); return 0; }