#include <stdio.h>
int main(void)
{
int n = 0;
int i = 0;
int s = 0;
printf("Please enter value for N\n");
s = 0;
for (i = 1; i <= n; i += 1)
{
if (i % 2 == 0) {
s = s + i;
printf("Current value i=%d S=%d\n", i
, s
); }
}
printf("Final result suma is S=%d", s
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSAKewogICAgaW50IG4gPSAwOwogICAgaW50IGkgPSAwOwogICAgaW50IHMgPSAwOwogICAgCiAgICBwcmludGYoIlBsZWFzZSBlbnRlciB2YWx1ZSBmb3IgTlxuIik7CiAgICBzY2FuZigiJWQiLCAmbik7CiAgICAKICAgIHMgPSAwOwogICAgZm9yIChpID0gMTsgaSA8PSBuOyBpICs9IDEpIAp7CiAgICAgICAgaWYgKGkgJSAyID09IDApIHsKICAgICAgICAgICAgcyA9IHMgKyBpOwogICAgICAgICAgICBwcmludGYoIkN1cnJlbnQgdmFsdWUgaT0lZCBTPSVkXG4iLCBpLCBzKTsKICAgICAgICB9CiAgICB9CiAgICAKICAgIHByaW50ZigiRmluYWwgcmVzdWx0IHN1bWEgaXMgUz0lZCIsIHMpOwogICAgCiAgICByZXR1cm4gMDsKfQ==