Question 41

What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
class complex{
double re;
double im;
public:
complex() : re(0),im(0) {}
complex(double x) { re=x,im=x;};
complex(double x,double y) { re=x,im=y;}
void print() { cout << re << " " << im;}
};
int main(){
complex c1;
c1 = 3.0;
c1.print();
return 0;
}
  • Question 42

    What happens when you attempt to compile and run the following code?
    #include <iostream>
    using namespace std;
    class A
    {
    public:
    virtual void Print(){ cout<<"A";}
    };
    class B:public A
    {
    public:
    virtual void Print(){ cout<< "B";}
    };
    int main()
    {
    A *obj;
    A ob1;
    obj = &ob1;
    obj?>Print();
    B ob2;
    obj = &ob2;
    obj?>Print();
    }
  • Question 43

    What happens when you attempt to compile and run the following code?
    #include <iostream>
    using namespace std;
    int main(){
    int i = 1;
    if (--i==1) {
    cout << i;
    } else {
    cout << i-1;
    }
    return 0;
    }
  • Question 44

    What is the output of the program?
    #include <iostream>
    #include <string>
    using namespace std;
    struct Person {
    int age;
    };
    class First
    {
    Person *person;
    public:
    First() {person = new Person;
    person?>age = 20;
    }
    void Print(){
    cout << person?>age;
    }
    };
    int main()
    {
    First t[2];
    for (int i=0; i<2; i++)
    t[i].Print();
    }
  • Question 45

    What happens when you attempt to compile and run the following code?
    #include <iostream>
    using namespace std;
    int main(){
    int i = 1;
    for(i=10; i>-1; i/=2) {
    if(!i)
    break;
    }
    cout << i;
    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
    5468C++Institute.CPA.v2022-06-22.q125
    Latest Upload
    149Huawei.H13-511_V5.5.v2026-12-04.q104
    134CuramSoftware.CS0-004.v2026-12-04.q100
    123Oracle.1Z0-183.v2026-12-04.q24
    124Apple.App-Development-with-Swift-Certified-User.v2026-12-04.q14
    194EMC.D-AV-DY-23.v2026-12-03.q139
    146Cisco.350-101.v2026-12-03.q78
    294Nutanix.NCP-DB.v2026-12-02.q164
    167Huawei.H19-110_V2.0.v2026-12-02.q44
    249EXIN.ITILFNDv4.v2026-12-01.q148
    263VMware.2V0-13.25.v2026-12-01.q134