Decide Fast & Get 50% Flat Discount | Limited Time Offer - Ends In 0d 00h 00m 00s Coupon code: SAVE50

Master C++ Institute CPA-21-02 Exam with Reliable Practice Questions

Page: 1 out of Viewing questions 1-5 out of 257 questions
Last exam update: Nov 15,2024
Upgrade to Premium
Question 1

What will happen when you attempt to compile and run the following code?

#include

using namespace std;

#define A 1

int main()

{

#if A

cout<<"Hello";

#endif

cout<<"world";

return 0;

}


Correct : A


Options Selected by Other Users:
Mark Question:

Start a Discussions

Submit Your Answer:
0 / 1500
Question 2

What will be the output of the program?

#include

#include

using namespace std;

int fun(int);

int main()

{

float k=3;

k = fun(k);

cout<

return 0;

}

int fun(int i)

{

i++;

return i;

}


Correct : C


Options Selected by Other Users:
Mark Question:

Start a Discussions

Submit Your Answer:
0 / 1500
Question 3

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

#include

using namespace std;

int main()

{

const char *s;

char str[] = "Hello";

s = str;

while(*s) {

cout << *s++;

}

return 0;

}


Correct : B


Options Selected by Other Users:
Mark Question:

Start a Discussions

Submit Your Answer:
0 / 1500
Question 4

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

#include

#include

using namespace std;

int main()

{

string s1[]= {"How" , "to" };

s1[0].swap(s1[1]);

for (int i=0; i<2; i++) {

cout << s1[i];

}

return( 0 );

}


Correct : B


Options Selected by Other Users:
Mark Question:

Start a Discussions

Submit Your Answer:
0 / 1500
Question 5

What is the meaning of the following declaration? (Choose two.)

char **ptr;


Correct : A, B


Options Selected by Other Users:
Mark Question:

Start a Discussions

Submit Your Answer:
0 / 1500