Function Definition
Write a program that defines a function of type
void called
printmessage(). The
function outputs a
"Hello World from a function." message on the standard output. Call the function from
main.
void printmessage()
{
std::cout << "Hello World from a function.";
}
int main()
{
printmessage();
}
Output:Hello World from a function.
Separate Declaration and Definition
Write a program that declares and defines a function of type void called printmessage(). The function outputs a "Hello ...