Infosys interview question

Tell me about Diode , Write a C program (moderate level of difficulty)