Posted on
4/5 - (1 vote)

The Best CPA Exam Study Material and Preparation Test Question Dumps

Get Ready to Pass the CPA exam Right Now Using Our C++ Certified Exam Package

C++ Primer (5th Edition) by Stanley Lippman, Josée Lajoie, and Barbara Moo

This is a leading book on Amazon concerning the C++ programming training which has recently been updated according to the C++11 standards. It helps the candidate learn the concepts and skills necessary for solving urgent tasks in the modern industry. This guide is formulated to assist candidates in understanding the features and functions of the standard C++ library, and writing programs without mastering all the details of the language. Thus, the learner gets introduced to modern-day coding, making the book ideal for both beginners and proficient in this field. As a result, you will train the concepts and skills needed for the CPA exam passing, making it one of the best support materials in the market.

 

QUESTION 51
Which of the following can be checked in a switch?case statement?

 
 
 
 

QUESTION 52
What is the output of the program?
#include <iostream> #include <string>
using namespace std;
union t { char c; int i; };
class First { union t u; public: First() {
u.c = ‘A’;
}
void Print(){
cout << u.c;
}
};
int main()
{
First *t = new First();
t->Print();
}

 
 
 
 

QUESTION 53
What will the variable “age” 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 54
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int main()
{
const int x=20;
const int *ptr;
ptr = &x;
*ptr = 10;
cout<<*ptr;
return 0;
}

 
 
 
 

QUESTION 55
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int op(int x, int y);
int main()
{
int i=2, j=2, k;
float f=0.3;
k = op(i, j);
cout<< k << “,” << op(1, f);
return 0;
}
int op(int x, int y)
{
return x+y;
}

 
 
 
 

QUESTION 56
What will happen when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int main()
{
const char *s;
char str[] = “Hello “;
s = str;
while(*s) {
cout << *++s;
*s++;
}
return 0;
}

 
 
 
 

QUESTION 57
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
void fun(int*);
int main()
{
int i=2;
fun(&i);
cout<<i;
return 0;
}
void fun(int *i)
{
*i = *i**i;
}

 
 
 
 

QUESTION 58
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int main (int argc, const char * argv[])
{
int tab[5]={1,2,3};
for (int i=0; i<5; i++)
cout <<tab[i];
return 0;
}

 
 
 
 

QUESTION 59
Which code, inserted at line 10, generates the output “2?1”?
#include <iostream>
#include <string>
using namespace std;
class A {
protected:
int y;
public:
int z;
};
//insert code here
public:
void set() {
y = 2;
z = 3;
}
void Print() { cout << y << z; }
};
int main () {
B b;
b.set();
b.z
= ?1; b.Print(); return 0; }

 
 
 
 

QUESTION 60
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
void fun(int*);
int main()
{
int *x;
int i=2;
x=&i;
fun(x);
cout<<i;
return 0;
}
void fun(int *i)
{
*i = *i * *i;
}

 
 
 
 

QUESTION 61
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int main()
{
float x=3.5,y=1.6;
int i,j=2;
i = x + j + y;
cout << i;
return 0;
}

 
 
 
 

QUESTION 62
What happens when you attempt to compile and run the following code?
#include <iostream>
#include <string>
using namespace std;
class A {
public:
A() { cout << “A0 “;}
A(string s) { cout << “A1”;}
};
class B : public A {
public:
B() { cout << “B0 “;}
B(string s) { cout << “B1 “;}
};
class C : private B {
public:
C() { cout << “C0 “;}
C(string s) { cout << “C1 “;}
};
int main () {
B b1;
C c1;
return 0;
}

 
 
 
 

QUESTION 63
What will be the output of the program?
#include <iostream>
using namespace std;
int main()
{
const int y = 5;
const x = ?10;
cout<<x<<” “<<y;
return 0;
}

 
 
 
 

QUESTION 64
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 65
What happens if character 3 is entered as input?
#include <iostream>
using namespace std;
class A {
public:
int i;
};
int main () {
int c;
A obj;
obj.i = 5;
cin >> c;
try
{
switch (c)
{
case A. throw 20;
case B. throw 5.2f;
case C. throw obj;
default: cout<<“No exception”;
}
}
catch (int e)
{ cout << “int exception. Exception Nr. ” << e; }
catch (A e)
{ cout << “object exception. Exception Nr. ” << e.i; }
catch (…)
{ cout << “An exception occurred.”; }
return 0;
}

 
 
 
 

QUESTION 66
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 67
What is the output of the program?
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1=”Wo”;
string s2;
s2 = s1;
string s3;
s3 = s2.append(“rldHello”);
cout << s3;
return( 0 );
}

 
 
 
 

QUESTION 68
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 69
What happens when you attempt to compile and run the following code?
#include <iostream>
#include <cstdarg>
using namespace std;
int mult(int f, int s, int t);
int main()
{
cout << mult(1,2,3);
return 0;
}
int mult(int f, int s, int t)
{
int mult_res;
mult_res = f*s*t;
return mult_res;
}

 
 
 
 

QUESTION 70
What is the output of the program given below?
#include <iostream>
using namespace std;
int main (int argc, const char * argv[])
{
int i=10;
{
int i=0;
cout<<i;
}
cout<<i;
return 0;
}

 
 
 
 

QUESTION 71
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;
}

 
 
 
 

Get Special Discount Offer of CPA Certification Exam Sample Questions and Answers: https://www.passleadervce.com/c-plus-plus-certified/reliable-CPA-exam-learning-guide.html

         

Related Links: myportal.utt.edu.tt myportal.utt.edu.tt myportal.utt.edu.tt myportal.utt.edu.tt myportal.utt.edu.tt myportal.utt.edu.tt

Leave a Reply

Your email address will not be published. Required fields are marked *

Enter the text from the image below