Hi iam new to c programming and iam trying to compile this code in Dev C ++ 4.9.9.2 and it prints the result but when i compile it works but it closes the screen and i cant see the results.
Thanks for your help
Code:
// Description: will ask the user for 2 numbers and print the even //numbers in between
#include <stdio.h>
int main()
{
int min, max, i;
printf("Please enter the minimum number: ");
scanf("%d", &min);
printf("Please enter the maximum number: ");
scanf("%d", &max);
for (i=min; i<=max; i++)
if (i%2 == 0)printf("%d\n", i);
getchar(); // when you use Dev c ++
return 0;
}