#include <stdio.h> int main() { int n=20,i,sum; printf ("Enter the number:%d\n",n); for (i=0;i<=n;i+=2) sum+=i; printf ("sum of all even numbers:%d\n",sum); return 0; }
To embed this program on your website, copy the following code and paste it into your website's HTML: