I can enter if but not execute statements inside

try this

char c = respuesta[respuesta.length() -1];
Serial.print("Charcode of the last char in respuesta: ");
Serial.println((uint8_t)c);