Sum = 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16.... + N, the user has to enter the value of N and N should be an even number, if N was entered as an odd number you should print a message "Wrong Input!”, otherwise find the sum of the series.

Respuesta :

I am writing down the solution in python language.


sum = 0

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

if N%2==0:

  sum = sum + N

else:

  print("wrong input")


This is the solution of the problem i hope you get the idea.

Thanks