2.5k views
2 votes
write a program to read 10 numbers and find their sum of the even number among them(i.e,100+200+360+96+2)​

1 Answer

4 votes

Answer:

Sure, here's a simple Python program that reads 10 numbers and calculates the sum of the even numbers among them:

```python

# Initialize a variable to store the sum

sum_of_even_numbers = 0

# Read 10 numbers from the user

for i in range(10):

number = int(input("Enter a number: "))

# Check if the number is even

if number % 2 == 0:

sum_of_even_numbers += number

# Print the sum of even numbers

print("Sum of even numbers:", sum_of_even_numbers)

```

You can run this program, and it will prompt you to enter 10 numbers. After you've entered all the numbers, it will calculate and display the sum of the even numbers among them.

User Anre
by
8.5k points