Code:
int main() { char *name=NULL; int n; printf(\"\\nenter the string\\n\"); scanf(\"%s\",name); n=strlen(name); printf(\"%d\",n); return 0; } >
You didn't allocate any memory for pointer to char name.
name
Example:
char * name = malloc( sizeof( char ) * MAX_STRING_LENGTH ) ;