Simple calculator problem
Assuming I understood what you are trying to do (subtraction  when '-' is pressed and addition when '+' is pressed), use the following:

#include &lt;Keypad.h&gt;

const byte numRows = 4; //number of rows on the keypad
const byte numCols = 4; //number of columns on the keypad

//keymap defines the key pressed according to the row and columns just as appears on        the keypad
char keymap[numRows][numCols] =
{
    {'1', '2', '3', '+'},
    {'4', '5', '6', '-'},
    {'7', '8', '9', 'C'},
    {' ', '0', '=', 'D'}
};

//Code that shows the the keypad connections to the arduino terminals
byte rowPins[numRows] = {11, 10, 9, 8}; //Rows 0 to 3
byte colPins[numCols] = {7, 6, 5, 4}; //Columns 0 to 3

//initializes an instance of the Keypad class
Keypad myKeypad = Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols);

long num1, num2, answer;
boolean mySwitch = false;
boolean do_subtraction_flag = false;  // when true we will apply subtraction

void setup()
{
    Serial.begin(9600);
    num1 = 0;
    num2 = 0;
}

//If key is pressed, this key is stored in 'keypressed' variable
//If key is not equal to 'NO_KEY', then this key is printed out
//if count=17, then count is reset back to 0 (this means no key is pressed during the   whole keypad scan process


void loop()
{
    char keypressed = myKeypad.getKey();

    if(keypressed != NO_KEY)
    {

        //Serial.print(keypressed - 48);
        Serial.print(keypressed);

        if(keypressed &gt; 47 &amp;&amp; keypressed &lt; 58)  // is between '0' and '9'
        {
            if(!mySwitch)
            {
                num1 = (num1 * 10) + (keypressed - 48);
            }
            else
            {
                num2 = (num2 * 10) + (keypressed - 48);
            }
        }

        if(keypressed == '=')
        {
            if(do_subtraction_flag)  // we want to subtract the numbers
            {
                answer = num1 - num2;
            }
            else  // we want to add the numbers
            {
                answer = num1 + num2;
            }

            Serial.println(answer);
            num1 = 0;
            num2 = 0;
            mySwitch = false;
            do_subtraction_flag = false;
        }
        else if(keypressed == '+')
        {
            mySwitch = true;
        }
        else if(keypressed == '-')
        {
            mySwitch = true;
            do_subtraction_flag = true;
        }
    }
}




I have added a flag Boolean variable named do_subtraction_flag
The flag is set depending on the button used, false for addition and true for subtraction.
Its value is used when '=' is pressed to conditionally execute the code that either subtracts num2 from num1 or adds them.

Note that I have replaced keypressed == 61 with keypressed == '='
and keypressed == 43 with keypressed == '+'
It is much easier to read the code this way.