Can anyone help to find the error in the code because it is not able to print anything on the console. I have also try to change the pins of UART but then also it is not be to print anything on the console.
Start with a minimal example which just sends a fixed message
sending continuous uppercase 'U' is good - as you can then easily check that on a 'scope, see if the baud rate is correct, etc
Then try receiving, and doing a simple loop-back ...
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.