What will the variable "age" be in class B?class A {int x;protected:int y;public:int age;};class B : private A {string name;public:void Print() {cout << name << age;}};
Answer(s): B
What happens when you attempt to compile and run the following code?#include <iostream>using namespace std;int x=5;static int y;int i=0;void static myFunction(){y=x++ + ++i;}int main (int argc, const char * argv[]){x++;myFunction();cout<<y<<" "<<x<< " " << i;}
Answer(s): C
Which of the structures is incorrect?1:struct s1{int x;long int li;};2:struct s2{float f;struct s2 *s;};3:struct s3{float f;struct s3 s;};
What is the output of the program?#include <iostream>#include <string>using namespace std;int main(){string s1="Wo";string s2;s2 = s1;string s3;s3 = s2.append("rldHello");cout << s3;return( 0 );}
Answer(s): A
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
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.
We’re offering these study questions to support your success. The least you can do? Drop a useful comment about each question. Help others. Build the community.