7 segment display

Write a program to display any digit(n) from 0-9 using “7 segment display”.
For example:

input : 5

output :
_
|_
_|

can anyone pls help me with the code of this question ?