scanf の中の人が %c というフォーマット指定から、渡された引数の大きさを char と期待して書き込んでいるから。

char x;
int v;
.....
scanf("%c", &x); v=x;
printf("%d\n",v);

とすればよかろう