As the picture shows, it seems like the program does not recognize the characters entered by the user. I tried to make N as an array or initialized N = with those characters but it still won't work.
The code is:
#include <stdio.h>
int main()
{
int a, b, c;
char N;
printf("Please enter a value for num 1 \n");
scanf_s("%d", &a, sizeof(a));
printf("Please enter a value for num 2 \n");
scanf_s("%d", &b, sizeof(b));
printf("Please enter a character \n");
scanf_s("%s",&N, sizeof(N));
switch (N)
{
case '+' : c = (a + b); printf("The sum is : %d \n", c); break;
case '-' : c = (a - b); printf("The subtraction is : %d \n", c); break;
case '*' : c = (a * b); printf("The muliplication is : %d \n", c);
break;
case '/' : c = (a / b); printf("The division is : %d \n", c); break;
default: printf("Please enter these characters only : + - * / \n");
}
getch();
return 0;
}