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 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