Mphasis Interview Question

In Technical round they asked for 2 codes. 1. Prime numbers 2. Swap numbers without using 3rd variable.