Wipro interview question

For ECE domain people: Explain about semi conductors with examples. What are active and passive elements. Write a code to check whether the given number is prime number or not.