At the end of the
main
function the program terminates and control is back to OS.
A workaround to keep the program alive is asking the user for another input, try
#include<stdio.h>
int main()
{
int num;
printf("Digite um numero inteiro: ");
scanf("%d",&num);
if (num % 2 == 0)
{
printf("Este numero e par!\n");
}
else
{
printf("Este numero e impar!\n");
}
printf("program is paused. Please enter a key to exit\n");
scanf("%d", &num);
return 0;
}