What is the output of the program?
#include
using namespace std;
#define SQR(x)(x*x)
int main(int argc, char *argv[]) {
int x, y=2;
x = SQR(y);
cout << x << ", " < return 0; } A. It prints: 3, 2 B. It prints: 4, 2 C. It prints: 3, 3 D. It prints: 9, 2
What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class Base
{
string s;
public:
Base() { s="Sample text";}
Base(string s) { this?>s=s; }
void Print() { cout << s; }
};
int main()
{
Base *o = new Base();
o?>Print();
}
A. It prints: Sample text
B. It prints: Sample
C. It prints: text
D. None of these
What happens when you attempt to compile and run the following code?
A. It prints: 4
B. It prints: 1
C. It causes a compilation error
D. lit prints: 0
What happens when you attempt to compile and run the following code?
#include
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 = andob1;
obj?>Print();
B ob2;
obj = andob2;
obj?>Print();
}
A. It prints: AB
B. It prints: AA
C. It prints: BA
D. It prints: BB
What happens when you attempt to compile and run the following code?
A. It prints: 1
B. It causes a compilation error
C. It prints: 0
D. It prints: My exception,
What happens when you attempt to compile and run the following code?
A. It prints: 33
B. It prints: 007
C. It causes a compilation error
D. lit prints: 9
Which of the following statements may completely ignore their bodies (inner statements)? (Choose three.)
A. do
B. swicch
C. for
D. while
What is the output of the program?
#include
#include
using namespace std;
int main()
{
string s1[]= {"H" , "t" };
string s;
for (int i=0; i<2; i++) {
s = s1[i];
s.insert(1,"ow");
cout << s;
}
return( 0 );
}
A. It prints: How
B. It prints: Ht
C. It prints: Hoto
D. It prints: Howtow
Which code line instead of the comment below will cause the program to produce the expected output?
A. a = b * c;
B. return a = b * c;
C. return a = b * *c;
D. a = b * *c;
What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
struct Person {
string name;
int age;
};
class First
{
Person *person;
public:
First() {person = new Person;
person?>name = "John";
person?>age = 30;
}
void Print(){
cout<
}
};
int main()
{
First t;
t.Print();
}
A. It prints: 30
B. It prints: John
C. It prints: John 30
D. It prints: John 30John 30
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only C++ Institute exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your CPA-21-02 exam preparations and C++ Institute certification application, do not hesitate to visit our Vcedump.com to find your solutions here.