Question: / * Exercises: 1 . Complete the program below. Sample Run: Hello from main! Hello from the writeMessage function! Write a custom message: Hello! Hello!
Exercises:
Complete the program below.
Sample Run:
Hello from main!
Hello from the writeMessage function!
Write a custom message: Hello!
Hello!
Back in main!
This program prints a message by calling a function.
#include Required for cin and cout
#include Required for string
using namespace std; Required for not having to use std::
Write a message to the console from a function
void writeMessage;
void writeCustomMessagestring message;
The main function
int main
cout "Hello from main!" endl;
TODO: Call the writeMessage function
string customMessage;
cout "Write a custom message: ;
cin customMessage;
TODO: Call the writeCustomMessage function with the customMessage as a parameter
cout "Back in main!" endl;
return ;
The function to write a message
void writeMessage
cout "Hello from the writeMessage function!" endl;
The function to write a custom message
void writeCustomMessagestring message
cout message endl;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
