Problem in Serial Communication.

Compiles under windows....

there is no issue in uploading and verifying. when i try to communicate through serial monitor after sending one value it just displays this value and when i try to upload again it asks me to change the serial port. do not want to re-install my operating system

So, if one can compile and upload, one realizes that the basic serial/USB functionality in the Arduino and in the OS are working as are the cables and ports.

When you run the sketch, you get an error. This appears to be a serial issue either in how the OS is managing serial for the Arduino or the serial communications protocol, etc. Try running a serial loopback example on the Mega2560.
Something like: Loop-Back Test Instructions - IDE 1.x - Arduino Forum

Maybe try another USB port, too, or try through a powered-hub. When you do these things, the OS builds new entries for the devices.