#include <iostream>
using namespace std;
int main() {
int number;
int total;
cout << "Enter a number\n";
cin >> number;
total = 0;
for (int i =0; i <= number ; i++)
{
total += i;
}
cout << "Sum of numbers from 1 to " << number << " is " << total << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkKCQoJaW50IG51bWJlcjsKCWludCB0b3RhbDsKCQoJY291dCA8PCAiRW50ZXIgYSBudW1iZXJcbiI7CgljaW4gPj4gbnVtYmVyOwoJCgl0b3RhbCA9IDA7CgkKCWZvciAoaW50IGkgPTA7IGkgPD0gbnVtYmVyIDsgaSsrKQoJewoJCXRvdGFsICs9IGk7Cgl9CgkKCWNvdXQgPDwgIlN1bSBvZiBudW1iZXJzIGZyb20gMSB0byAiIDw8IG51bWJlciA8PCAiIGlzICIgPDwgdG90YWwgPDwgZW5kbDsKCXJldHVybiAwOwp9