What happens when you attempt to compile and run the following code?#include <iostream>using namespace std;int main(){int *t;t = new int[2];for (int i=0; i<2; i++) {t[i]=0;}cout << t[1];}
Answer(s): A
What happens when you attempt to compile and run the following code?#include <iostream>using namespace std;int main(){int x=2, *y, z=3;y = &z;cout<<x**y*x***y;return 0;}
Answer(s): D
What happens when you attempt to compile and run the following code?#include <iostream>using namespace std;#define DEF_A 0int main(int argc, char *argv[]) {cout << DEF_A;return 0;}
Answer(s): B
What happens when you attempt to compile and run the following code?#include <iostream>#include <exception>using namespace std;class myClass : public exception{virtual const char* what() const throw(){return "My exception.";}} obj;int main () {try{throw obj;}catch (exception& e){cout << e.what() << endl;}return 0;}
Post your Comments and Discuss C++ Institute CPA-21-02 exam with other Community members:
Subash Commented on December 10, 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
To protect our content from bots for real learners like you, we ask you to register for free. Sign in or sign up now to continue with the CPA-21-02 material!