//Count all even numbers from m to n using while 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",&n);
printf("m = %d, n=%d\n",m,n);
while(m<=n)
{
if(m%2==0)
count++;
m++;
}
printf("Count of even= %d",count);

return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: