Problem Description
Python Program to Find the Sum of First N Natural Numbers
Input
Value of "N"
Output
Print the Sum of N natural NumbersCODING ARENA
m=int(input())
sum1=0
while(m>0):
sum1=sum1+m
m=m-1
print(sum1)
Test Case 1
Input (stdin)18
Expected Output171
Test Case 2
Input (stdin)167
Expected Output14028
No comments:
Post a Comment