What happens when you attempt to compile and run the following code?#include <iostream>using namespace std;#include <iostream>using namespace std;class First{public:void Print(){ cout<<"from First";}};int main(){First t[2];for (int i=0; i<2; i++)t[i].Print();}
Answer(s): B
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;}
Answer(s): C
What happens when you attempt to compile and run the following code?#include <iostream>#include <string>using namespace std;class A {public:int x;A() { x=0;}A(int x) { this?>x=x;}};class B : private A {public:using A::x;B() { x=1;}B(int x) {this?>x = x;}};int main () {B c1;B c2(?5);cout << c1.x;cout << c2.x;return 0;}
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 a = 30, b = 1, c = 5, i=10;i = b < a < c;cout << i;return 0;}
Answer(s): D
Post your Comments and Discuss C++ Institute CPA-21-02 exam with other Community members:
Subash commented on October 21, 2024 I am planning to take this exam. Are these 257 questions enough to clear it? Also, does each section have a passing percentage, or is it based on the overall ? INDIA upvote
Our website is free, but we have to fight against bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the CPA-21-02 content, but please register or login to continue.