I'm a beginner with a few hours of expirience and I'm trying to make a really simple program to get familiar withe IF command. I came up with this code:

```
#include<stdio.h>

int main()
{
    char ans;
    char n;
    char y;
    printf("Do you want to exit?\n");
    scanf("%c\n",ans);
    if (ans == y)
    {
        printf("As you wish!\n");
        return 0;
    }
    else (ans == n);
    {
        printf("You'll exit anyways!\n");
        return 0;
    }
}

```

I think it should work, but after I type something the program stops workig! Thanks in advance!