I tried out BlinkRGB example and it worked well. but when I tried using serial.print(), the program is uploaded without error, but I am unable to see anything on the serial monitor.
I tried using multiple baud rates, I tried by enabling the usb-cdc in the tools. But no use.
Please post your sketch, using code tags when you do
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.
Did you upload the sketch again after doing that? Changing the selection in Arduino IDE's Tools > USB CDC On Boot menu only takes effect after you upload a new sketch to the board.