Improve Your Knowledge with CPA-21-02 Exam Dumps

Category:

Comments:

Post Date:


Practicing with CPA-21-02 questions can help you identify areas where you need to improve your knowledge. By answering CPA-21-02 questions and reviewing your responses, you can identify gaps in your understanding and focus your study efforts on those areas. The CPA-21-02 exam has a strict time limit, and you need to manage your time effectively to answer all the questions. Practicing with C++ Institute CPA-21-02 dumps questions can help you develop time management skills by simulating the exam's time constraints. You'll learn how to pace yourself, manage your time effectively, and ensure that you complete the CPA-21-02 exam within the allotted time. Test C++ Institute CPA-21-02 exam free dumps below.

Page 1 of 8

1. Which of the following can be checked in a switch? Case statement?

2. What happens when you attempt to compile and run the following code?

#include

using namespace std;

int main(){

int i = 1;

if (i++==1) {

cout << i;

} else {

cout << i-1;

}

return 0;

}

3. What happens when you attempt to compile and run the following code?

#include

using namespace std;

#define FUN(arg) if(arg) cout<<"Test";

int main()

{

int i=1;

FUN(i<3);

return 0;

}

4. What happens when you attempt to compile and run the following code?

#include

#include

using namespace std;

void fun(int i);

int main()

{

int i=0;

i++;

for (i=0; i<=5; i++)

{

fun(i);

}

return 0;

}

void fun(int i)

{

if (i==3)

return;

cout << i;

}

5. If there is one, point out an error in the program

#include

using namespace std;

int main()

{

int i=1;

for(;;)

{

cout<
if(i>5)

break;

}

return 0;

}

6. Which of the structures is incorrect?

1:

struct s1{

int x;

long int li;

};

2:

struct s2{

float f;

struct s2 *s;

};

3:

struct s3{

float f;

struct s3 s;

};

7. What is the output of the program?

#include

#include

using namespace std;

class First

{

string name;

public:

First() {

name = "Alan";

}

void setName(string n) {this?>name = n;}

void setName() {this?>name = "John";}

void Print(){

cout << name;

}

};

int main()

{

First ob1, *ob2;

ob2 = new First();

First *t;

t = &ob1;

t?>setName();

t?>Print();

t = ob2;

t?>setName("Steve");

ob2?>Print();

}

8. What happens when you attempt to compile and run the following code?

#include

using namespace std;

class A {

public:

void Print(){ cout<<"A"; }

};

class B:public A {

public:

virtual void Print(){ cout<< "B"; }

};

class C:public B {

public:

void Print(){ cout<< "C"; }

};

int main()

{

A ob1;

B ob2;

C ob3;

A *obj;

obj = &ob1;

obj?>Print();

obj = &ob2;

obj?>Print();

obj = &ob3;

obj?>Print();

}

9. What happens when you attempt to compile and run the following code?

#include

using namespace std;

int main(){

int i = 1;

for(i=10; i>-1; i/=2) {

if(!i)

break;

}

cout << i;

return 0;

}

10. What happens when you attempt to compile and run the following code?

#include

using namespace std;

void set(struct person*);

struct person

{

int age;

};

int main()

{

struct person e = {18};

set(&e);

cout<< e.age;

return 0;

}

void set(struct person *p)

{

p?>age = p?>age + 1;

}


 

TAGS:

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Related

Posts