#include <stdio.h>
int main() {
int N, sum = 0;
printf("Enter the value of N: ");
scanf("%d", &N);
for (int i = 1; i <= N; i++) {
if (i % 2 == 0) {
// If it's even, add it to the sum
sum += i;
}
}
printf("The sum of all even numbers between 1 and %d is: %d\n", N, sum);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: