you can use this logic

if the mod ( % ) of no is == 0 the no is even .. and use a variable (say) sum=sum+no;
initially sum will be declared as 0
and no. is the no. that is provided by the...