Recently i have started working on built-in functions but came up with an error and that is:
Why am i getting segmentation fault for this program
#include<stdio.h>
#include<ctype.h>
int main()
{
    char str[50];
    int n;
    printf("Who is your best friend? ");
    scanf("%s",str);
    n=isalpha(str);
    if(n!=0)
    {
        printf("Is Alpha");
    }
    else
    {
        printf("Invalid Input");
    }
    return 0;
}
Please help me out...
 
    