This is in C. I am trying to use getchar to take input from a user and perform the operation. For example user enters 2 - 1 and it outputs 1. I have the individual characters stored in their own variables integer1, integer2 and sign. I know it works because when I do printf("%c", integer2) for example it shows up properly. However in the switch case to determine what operation must take place based on the sign variable it gives me a random number for the output. A picture of the program is Attached. 
I tested my logic of skipping white space and storing the individual characters and they store properly using %c. I also tried changing from int to char and vice versa but it did not work either. I had it working in the beginning but only for the "-" operator.