What is the output of the program?#include <iostream>#include <string>using namespace std;class First{string name;public:First() {name = "Alan";}void setName(string n) {this?>name = n;}void setName() {this?>name = "John";}void Print(){cout << name;}};int main(){First ob1,*ob2;ob2 = new First();First *t;t = &ob1;t?>setName();t?>Print();t = ob2;t?>setName("Steve");ob2?>Print();}
Answer(s): A
What is the output of the program given below?#include <iostream>using namespace std;int main (int argc, const char * argv[]){float f=?10.501;cout<<(int)f;}
Answer(s): C
What is the output of the program?#include <iostream>#include <string>using namespace std;int main(){string s1[]= {"H" , "t" };string s;for (int i=0; i<2; i++) {s = s1[i];if (i==0)
Answer(s): D
How many times will "HELLO" be printed?#include <iostream>using namespace std;int main(){for(int i=?1; i<=10; i++){if(i < 5)continue;else break;cout<<"HELLO";}return 0;}
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.