Question 16

What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int main()
{
int x=0;
int *ptr;
ptr = &x;
cout<<x<<" "<<*ptr;
return 0;
}
  • Question 17

    What happens when you attempt to compile and run the following code?
    #include <iostream>
    using namespace std;
    int main(int argc, char *argv[]) {
    char *s = "ABCDEF";
    cout << s+2;
    return 0;
    }
  • Question 18

    What will the variable "y" be in class B?
    class A {
    int x;
    protected:
    int y;
    public:
    int age;
    };
    class B : private A {
    string name;
    public:
    void Print() {
    cout << name << age;
    }
    };
  • Question 19

    Which code, inserted at line 10, generates the output "Hello World"?
    #include <iostream>
    #include <string>
    using namespace std;
    string fun(string, string);
    int main()
    {
    string s="Hello";
    string *ps;
    ps = &s;
    //insert code here
    return 0;
    }
    string fun(string s1, string s2)
    {
    return s1+s2;
    }
  • Question 20

    What happens when you attempt to compile and run the following code?
    #include <iostream>
    #include <string>
    using namespace std;
    class A {
    int x;
    protected:
    int y;
    public:
    int z;
    A() { x=1; y=2; z=3; }
    };
    class B : public A {
    public:
    void set() {
    y = 4; z = 2;
    }
    void Print() {
    cout << y << z;
    }
    };
    int main () {
    B b;
    b.set();
    b.Print();
    return 0;
    }
  • Premium Bundle

    Newest CPA Exam PDF Dumps shared by BraindumpsPass.com for Helping Passing CPA Exam! BraindumpsPass.com now offer the updated CPA exam dumps, the BraindumpsPass.com CPA exam questions have been updated and answers have been corrected get the latest BraindumpsPass.com CPA pdf dumps with Exam Engine here:

    (220 Q&As Dumps, 40%OFF Special Discount: Exam-Tests)
    Other Version
    4180C++Institute.CPA.v2024-03-18.q106
    Latest Upload
    167PaloAltoNetworks.SSE-Engineer.v2026-10-17.q44
    290Cisco.300-420.v2026-10-17.q324
    202Salesforce.MCE-Con-201.v2026-10-15.q108
    182EMC.NCA.v2026-10-15.q25
    283Apple.Apple-Device-Support.v2026-10-15.q159
    191F5.F5CAB3.v2026-10-14.q47
    190Oracle.1Z0-1048-25.v2026-10-14.q67
    268Cisco.300-730.v2026-10-14.q199
    259Salesforce.Sales-Admn-202.v2026-10-14.q160
    176ServSafe.ServSafe-Manager.v2026-10-13.q32