Baud rate of arduino uno

In my code, I changed the baud rate from 9600 to 2400, then from 2400 to 4800 and again from 4800 to 9600, now my serial port is not printing any data at 9600 which earlier used to print before making any changes in the baud rate means when earlier it was running at 9600. What could be the problem. How to troubleshoot it ????

apoorvarampal:
In my code,

If you want help you need to post your program. See How to use the Forum

...R

apoorvarampal:
now my serial port is not printing any data at 9600 which earlier used to print before making any changes

I guess you mean the serial monitor is not printing data received from Arduino at 9600. This would be because you have not changed the rate on the serial monitor to match the data transmitted. Since you have had the monitor work at 2400 and 4800, you already know the monitor and the Serial.begin command must match, and how to do it.