Summation of Natural Number Sequence with c and c++.
#include<bits/stdc++.h>
using namespace std;
int main()
{
unsigned int a, b;
long long int sum = 0, n;
double s1;
cin >> a >> b;
n = (b-a) + 1;
sum = n * ((double)(a+b) / 2);
cout << sum << endl;
return 0;
}