Cognizant interview question

Write merge sort logic and write prime number program.