int printfun(display());// Function prototype
That's not a function prototype. It's a variable declaration, equivalent to:
int printfun = display();
Function prototypes "can" be done inside main(), but it's much more normal to put them at the top of your source file.
#include <iostream>
using namespace std;
// Function prototypes.
int display();
int printfun(int x);
int main()
{
int a;
printfun(9); // Function call.
return 0;
}
// Function definitions.
int printfun(int x)
{
cout << "Welcome inside the function-" << x << endl;
}
int display()
{
printfun(9); // Function call.
cout << "Welcome inside the Display" << endl;
return 5;
}