Ask Question
6 February, 19:07

Write statements that output variable numComputers as follows. End with a newline

+4
Answers (1)
  1. 6 February, 20:38
    0
    Complete Question:

    Write statements that output variable numComputers as follows. End with a newline. There are 10 computers.

    #include

    using namespace std;

    int main ()

    {

    int numComputers;

    cin >> numComputers; / / Program will be tested with values: 10.

    ...

    return 0;

    }

    Answer:

    cout << "There are ";

    cout << numComputers;

    cout << " computers." << "/n";

    Explanation:

    Using three cout statements the string "There are 10 computers." is printed out, notice that the variable numComputers is entered by the user when the program is run. Another way of concatenating an integer variable and string for printout is by the use of the + (plus) operator.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write statements that output variable numComputers as follows. End with a newline ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers