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;}
Answer(s): C
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;}{int i=5;cout << i;}cout<<i;return 0;}
What happens when you attempt to compile and run the following code?#include <iostream>using namespace std;class First{public:void Print(){ cout<<"from First";}};class Second{public:void Print(){ cout<< "from Second";}};int main(){Second t[2];for (int i=0; i<2; i++)t[i].Print();}
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;}
Answer(s): B
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!