When the function is defined after the main function then there is an error called “function should have a prototype”. This is because of the function is defined after the main function. To resolve this a prototype should be declared inside the main function.