Sum of Series
Submissions: 8654   Accuracy:

52.42%

  Difficulty: School   Marks: 0
*School Problem's Submission isn't counted in score!

Write a program to find the sum of the given series 1+2+3+ . . . . . .(N terms) 

Input:
The first line of input contains an integer, the number of test cases T. Each test case should contain a positive integer N.

Output:
Print the sum in a separate line.

Constraints:
1 <= T <= 30
1 <= N <= 100

Example:
Input:
2
1
5

Output:
1
15

Explanation:
Testcase 2:
For n=5 , sum will be 1+2+3+4+5=15.

** For More Input/Output Examples Use 'Expected Output' option **

Author: abhiraj26


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.