What happens when you attempt to compile and run the following code?#include <iostream>using namespace std;int main(){int i = 0;i++;goto lab;i++;lab:cout<<i;return 0;}
Answer(s): C
What is the output of the program?#include <iostream>#include <string>using namespace std;int main(){char str[] = "Hello\0\World\0";cout << str;return 0;}
Answer(s): A
If there is one, point out an error in the program#include <iostream>using namespace std;int main(){int c = 'a';switch(i){case '2':cout<<"OK";case '1':cout<<"Error";default:break;}return 0;}
Answer(s): B
What happens when you attempt to compile and run the following code?#include <iostream>#include <string>using namespace std;class A {int x;protected:int y;public:int z;A() { x=1; y=2; z=3; }};class B : public A {string z;public:void set() { y = 4; z = "John"; }void Print() { cout << y << A::z; }};int main () {B b;
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.