Hi everyone,
Completely new to C and working on my own. I am using Code blocks. Why does this create a segmentation fault?
Code:#include <stdio.h> int main() { int x ; printf("Type in the key\n"); scanf("%d, &x"); if ( x == 10 ) { printf("Entered key number was correct!"); /* execute this line if above IF condition is TRUE*/ } else { printf("Entered key number was incorrect"); /* execute this line if above IF condition is FALSE*/ } return 0; }