Below mentioned C program allows the user to enter Minimum and maximum value. After that like the above-mentioned program, this C program will print even numbers in a given range.
#include<stdio.h>
int main()
{
int i, min, max;
printf("\n Please Enter the min Limit Value : ");
scanf("%d", &min);
printf("\n Please Enter the max Limit Values : ");
scanf("%d", &max);
if ( min % 2 != 0 )
{
min++;
}
printf("\n Even Numbers between %d and %d are : \n", min, max);
for(i = min; i <= max; i= i+2)
{
printf(" %d\t", i);
}
return 0;
}
Output:
Please Enter the min Limit Value: 5 Please Enter the max Limit Values: 10
Below mentioned C program allows the user to enter Minimum and maximum value. After that like the above-mentioned program, this C program will print even numbers in a given range.
Output:
Please Enter the min Limit Value: 5
Please Enter the max Limit Values: 10
Even Numbers between 6 and 10 are :
need an explanation for this answer? contact us directly to get an explanation for this answer6 8 10