Arduino LEONARDO able to receive serial data but NOT TRANSMITTING

Hi guys,
I've been using leonardo for quite some time. I tried bouncing back the data I sent from my serial monitor (to verify), but Serial.write() and Serial.print() commands are not returning anything. The date is being received correctly by leonardo, but it's not being sent back to the computer. The same code worked fine on MEGA. Another post on this forum suggested changing states of DTR and RTS bits (only for leonardo), but the procedure to do so was not mentioned (It has to be done in command prompt). Please help.

Thanks in advance.

char x;
void setup()
Serial.begin(9600); //I ignored the serial check required for arduino leonardo
void loop()
if (Serial.available() > 0)
{ x =;