fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int sum = 0;
  6. for (int i = 1; i <= 100; i++) {
  7. sum += i;
  8. }
  9. cout << "Sum of integers from 1 to 100 is: " << sum << endl;
  10. return 0;
  11. }
Success #stdin #stdout 0s 5296KB
stdin
Standard input is empty
stdout
Sum of integers from 1 to 100 is: 5050