CPP-Institute CPA-CPP Questions & Answers

Full Version: 220 Q&A






CPP-Institute
CPA
CPA - C++ Certified Associate Programmer
https://killexams.com/pass4sure/exam-detail/CPA
QUESTION: 213
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 :
void print() {
cout << "B ";
}
};
int main() {
B sc[2];
B *bc = (B*)sc;
for (int i=0; i<2;i++)
(bc++)->print();
return 0;
}
A. It prints: A A
B. It prints: B B
C. It prints: A B
D. It prints: B A
Answer: B
QUESTION: 214
What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class complex{
double re;
double im;
public:
complex() : re(1),im(0.4) {}
bool operator==(complex &t);
};
134
bool complex::operator == (complex &t){
if((this?>re == t.re) && (this?>im == t.im))
return true;
else
return false;
}
int main(){
complex c1,c2;
if (c1==c2)
cout << "OK";
else {
cout << "ERROR";
}
}
A. It prints: OK
B. It prints: ERROR
C. Compilation error
D. Runtime error.
Answer: A
QUESTION: 215
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main()
{
int i = 4;
while(i >= 0) {
cout< i??;
}
return 0;
}
A. It prints:”43210”
B. It prints:”3210”
C. It prints: ”3210?1”
D. None of these
135
Answer: A
QUESTION: 216
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;
}
A. It will print: Helloworld
B. It will print: Hello
C. It will print: world
D. It will print: 0
Answer: A
QUESTION: 217
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;
}
136
A. 3
B. 5
C. 4
D. 5
Answer: C
QUESTION: 218
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;
}
A. It prints: el
B. It prints: Hello
C. It prints: H
D. It prints: o
Answer: B
QUESTION: 219
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];
137
}
return( 0 );
}
A. It prints: Hoto
B. It prints: toHow
C. It prints: Ht
D. It prints: to
Answer: B
QUESTION: 220
What will variable "y" be in class B?
class A {
int x;
protected:
int y;
public:
int age;
};
class B : public A {
string name;
public:
void Print() {
cout << name << age;
}
};
A. public
B. private
C. protected
D. None of these
Answer: C

138
For More exams visit https://killexams.com/vendors-exam-list




Kill your exam at First Attempt....Guaranteed!

User: Lucas*****

The practice tests provided by Killexams.com were fantastic. Even though 76% is enough to pass the exam, I scored 92% marks on the real cpa-cpp exam. All credit goes to Killexams.com. Its tough to imagine that I could have passed the exam with any other product. This is an excellent product, and I highly recommend it.
User: Tiona*****

I made a smart choice by selecting killexams.com to help me prepare for the cpa-cpp exam. The well-structured styles and questions on the website allowed me to improve my knowledge by the time I reached the final simulation exam. I am grateful for the efforts and honesty of killexams.com, which helped me pass the exam. I appreciate their quality work and thank them for their support.
User: Olesya*****

After weeks of preparation with the Killexams.com set, I finally passed the CPA-CPP exam. I am relieved to leave it behind but happy that I found Killexams.com to help me get through it. The questions and answers in their package are accurate, and the questions were taken from the actual CPA-CPP exam, making the subjects much simpler. I even got higher marks than I had hoped for.
User: Maria*****

With only a week remaining until my CPA-CPP exam, I was not confident that I would pass. However, I decided to switch to killexams.com Questions and Answers for my exam preparation. To my surprise, the subjects I had previously found challenging were now more enjoyable to study, thanks to the smooth and concise way of getting to the important factors. Thanks to killexams.com Questions and Answers, I never thought that I would pass my exam, but I did, and I did so with flying colors.
User: Nellie*****

After deciding to take the cpa-cpp exam, I received valuable help from killexams.com. Their valid and reliable practice cpa-cpp materials were a great help in preparing me for the exam. I had the opportunity to test myself before feeling confident enough to take the exam, which helped me to score well. Thanks to Killexams, I was well-equipped to succeed in my exam.

Features of iPass4sure CPA-CPP Exam

  • Files: PDF / Test Engine
  • Premium Access
  • Online Test Engine
  • Instant download Access
  • Comprehensive Q&A
  • Success Rate
  • Real Questions
  • Updated Regularly
  • Portable Files
  • Unlimited Download
  • 100% Secured
  • Confidentiality: 100%
  • Success Guarantee: 100%
  • Any Hidden Cost: $0.00
  • Auto Recharge: No
  • Updates Intimation: by Email
  • Technical Support: Free
  • PDF Compatibility: Windows, Android, iOS, Linux
  • Test Engine Compatibility: Mac / Windows / Android / iOS / Linux

Premium PDF with 220 Q&A

Get Full Version

All CPP-Institute Exams

CPP-Institute Exams

Certification and Entry Test Exams

Complete exam list