the code is not letting me scan a character it ends the program instead,also the unit variable always returns 0 for no matter what the value is given
i tried taking the %s instead of %c which works but the units variable always returns 0 no matter the input
`
#include<stdio.h>
int main()
{
int x,y,units,n;
char direction;
printf("enter the co-ordinates [x] [y]:");
scanf("%d %d" , &x,&y);
printf("Enter No. units towards:");
scanf("%d",&units);
printf("Enter the [direction]:");
scanf("%c",&direction);
switch(direction)
{
case 'N':
y=y+units;
break;
case 'S':
y=y-units;
}
}
`