Friday, February 1, 2019

SUM OF THE SERIES

  • Problem Description

    Write a program to find sum of series
    Hint:1+2+3+4+n
  • CODING ARENA::
  • a=int(input())
    sum=0
    for i in range(1,a+1):
        sum=sum+i
    print(sum)
  • Test Case 1

    Input (stdin)
    18
    
    
    Expected Output
    171
  • Test Case 2

    Input (stdin)
    100
    
    
    Expected Output
    5050

No comments:

Post a Comment