Skip to content

Instantly share code, notes, and snippets.

@Svastikkka
Created June 21, 2020 03:23
Show Gist options
  • Save Svastikkka/2356119334faffca9357364ba69c19ce to your computer and use it in GitHub Desktop.
Save Svastikkka/2356119334faffca9357364ba69c19ce to your computer and use it in GitHub Desktop.
## Read input as specified in the question.
## Print output as specified in the question.
n=int(input())
sum=0
for i in range(1,n+1):
if (sum+i)%2==0:
sum=sum+i
print(sum)
@Svastikkka
Copy link
Author

Sum of Even Numbers till N

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment