C++ program to find the sum of n numbers using for loop

C++ program to find the sum of n numbers using for loop. Check the year is leap or not program in C++. This program will check the year whether it is leap year or not. This program will print the set of multiple number to add in a single program in c++ programming language

#include <iostream>
using namespace std;
int main()
{
int i,n, sum = 0;
cout << "Enter the number";
cin >> n;
for (i = 1; i <= n; ++i)
{
sum += i;
}
cout << "Sum = " << sum;
return 0;
}

Output:

Enter the number

44

Sum = 990