To write a program that calculates and prints the sum of all even numbers between 10 and 40 I have tried but i will waste characters showing it.?

1 answer

Answer

1281275

2026-07-12 04:40

+ Follow

In C:

#include <stdio.h>

int

main(void) {

int i, sum=0;

for (i=10; i<=40; i+=2) {

sum += i;

}

printf("%d\n", sum);

return 0;

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.