23.WAP to add n consecutive number with start with m
CODE:
n=int(input("Enter the Value on n\n"))
m=int(input("Enter the Value on m\n"))
sum=0
for i in range(m,m+n):
sum=sum+i
print("Sum is",sum)
OUTPUT:
Enter the Value on n
5
Enter the Value on m
1
Sum is 15
Comments
Post a Comment