#program to find sum of first fifty even numbers by python
Answers
Answered by
1
Answer:
# Sum of natural numbers up to num
num = 16
if num < 0:
print("Enter a positive number")
else:
sum = 0
# use while loop to iterate until zero
while(num > 0):
sum += num
num -= 1
print("The sum is", sum)
Similar questions
India Languages,
3 months ago
Environmental Sciences,
3 months ago
Math,
11 months ago
History,
11 months ago
Math,
11 months ago