1. Engineering
  2. Computer Science
  3. you are to determine the output of the c program...

Question: you are to determine the output of the c program...

Question details
  1. You are to determine the output of the C++ program below. In your answer, type exactly what this program would produce when compiled and run. Your answer should contain six lines of output.

    #include <iostream>
    using namespace std;
    int main()
    {
      int x = 5;
      double y = 7.8;
      string z = "Good";
      string w = " bye";
      int a = 0;
      cout << "Hello there\n";
      cout << y + 2.0 << "\n";
      cout << z + w << "\n";
      a = y;
      cout << "a is now: " << a << endl;
      cout << x / 2 << endl;
      cout << x / 2.0 << endl;
      return 0;
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution