This kinda functions are called signum functions.
Looking at the question
Put n=2(even)
Put n=3(odd)
Hence done .
You can take any input for your answer.
8.6m questions
11.2m answers