why does it giving correct ?



if n=6 then sum =21 which is not even
if i go by program it does n-1 , which is 5 and it’s sum=15 which is also not even.
can anyone tell please how does it working with 6 ?