sum of odd and even numbers while loop

sum_even=0
sum_odd=0
i=1
while(i<=10):
    x=int(input(" Enter a number"))
 
    if(x%2==0):
        sum_even+=x
    else:
        sum_odd+=x
    i=i+1
print("Sum Even :", sum_even)
print("Sum odd :", sum_odd)
   








For Other Programs Visit The WebSite:-   https://www.techapurba.com/

Follow Me On Social Media :-

For tech related videos visit my other website :- https://apurbatechinfo.blogspot.com/

Post a Comment

0 Comments