You are calling display
before declaring it. When you do so the compiler makes an assumption over the type of the return value. It assumes that it is int
. But when you define the function you use a return value of type void
which is the conflict.
It's been a very long time since anybody thought it was sound to call functions that have not been declared. So, declare all functions before calling them. It's best to configure your compiler so that it rejects attempts to call functions that have not been declared.