PROGRAM :-
import math
SUM = 0
n = int(input("Enter any integer value : "))
if n > 0:
for i in range(1,n+1):
SUM = SUM + i
print("Sum of the numbers upto ",n,":",SUM)
elif n == 0:
print("Sum is 0")
else:
print("Enter any + ve value")
import math
SUM = 0
n = int(input("Enter any integer value : "))
if n > 0:
for i in range(1,n+1):
SUM = SUM + i
print("Sum of the numbers upto ",n,":",SUM)
elif n == 0:
print("Sum is 0")
else:
print("Enter any + ve value")
VIDEO LINK : -
No comments:
Post a Comment
Note: only a member of this blog may post a comment.