#include <stdio.h>
int main()
{
int x;
printf("Enter the Number:");
scanf("%d", x);
if(x % 2 == 0){
printf("Number is even.\n");
printf("Thank you...\n");
}
else{
printf("Number is odd.\n");
printf("Thank you...\n");
}
return 0;
}
i have get the input with scanf and printed the input..
after getting the input ,it must check the condition i have given
but i got the result as
Enter the Number:4
Segmentation fault
why it print as segmentation fault why it not checked the condition then why i not got an error while compiling the code i have entered
@sibidharan