Arduino Mega 2560 Serial Input Cycle Problem

Only missing the setup section of the code. The failure is no data sent out to the serial port.
Eventually, I moved the serial port connection from USB to TX0 and RX0. It works well. Not sure whether it is the USB to UART conversion program issues in Arduino Mega 2560. Or may be the compatible hardware problem.