Tuesday, 6 November 2012

Sum of Even Numbers via For loop


sum=0
for i in range(1,50):
    if i%2==0:
        sum=sum+i
print sum

No comments:

Post a Comment