//Count all even numbers from m to n using for loop
#include<stdio.h>
int main()
{
int m,n,count=0;
printf("Enter m= \n");
scanf("%d",&m);
printf("Enter n= \n");
scanf("%d",&n);
for(;m<=n;m++)
{
if(m%2==0)
{count++;}
}
printf("Count of even between %d and %d = %d",m,n,count);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: