Question #39504

Write C++ program in which the main()function uses several cout statements to display
a memo to your boss. Use the company name “C++ Software Developers” at least three
times in the memo. Each time you want to display the company name, instead of using a
cout statement, call a function named companyName()that displays the name.

Expert's answer

Answer on Question#39504- Programming, C++

1. Write C++ program in which the main() function uses several cout statements to display a memo to your boss. Use the company name "C++ Software Developers" at least three times in the memo. Each time you want to display the company name, instead of using a cout statement, call a function named companyName() that displays the name.

Solution.

#include <iostream>
using namespace std;
char* companyName();
int main(int argc, char* argv[])
{
    cout << companyName() << endl;
    cout << companyName() << endl;
    cout << companyName() << endl;
    cin.get();
    return 0;
}
char* companyName()
{
    char* ch = "C++ Software Developers";
    return ch;
}
LATEST TUTORIALS
APPROVED BY CLIENTS