In: Computer Science
Write a program/code that prompts the user for a minimum min and a maximum max. Then use these values to print the squares of all even numbers between the min and max variables. (WRITTEN IN C)
For example if the user enters 6 as the minimum and 200 as the maximum, the program/code should print the following.
Enter limit on minimum square: 6
Enter limit on maximum square: 200
36
64
100
144
196
#include<stdio.h>
int main()
{
int min, max, i;
printf("Enter limit on minimum square: ");
scanf("%d",&min);
printf("Enter limit on maximum square: ");
scanf("%d",&max);
for(i = min;i*i<=max;i++){
if(i%2==0){
printf("%d\n",i*i);
}
}
return 0;
}