What is the output of the program?#include <iostream>using namespace std;#define SQR(x)(x*x)int main(int argc, char *argv[]) {int x, y=2;x = SQR(y);cout << x << ", " <<y;return 0;}
Answer(s): B
What will be the output of the program?#include <iostream>using namespace std;int main(){int i=0;for(; i<=5; i++)cout << i;return 0;}
Answer(s): A
What happens when you attempt to compile and run the following code?#include <iostream>using namespace std;class Base {int age;public:class C {int b;void PrintC() { cout << b; }};Base () {age=5;};void setAge(int a=20) {age = a;}void Print() { cout << age;}};int main () {Base a;
Answer(s): C
What happens when you attempt to compile and run the following code?#include <iostream>using namespace std;class complex{double re;double im;public:complex() : re(0),im(0) {}complex(double x) { re=x,im=x;};complex(double x,double y) { re=x,im=y;}void print() { cout << re << " " << im;}};int main(){complex c1;c1.print();return 0;}
What happens when you attempt to compile and run the following code?#include <iostream>using namespace std;int main(){int i = 0;i++;goto lab;i++;lab:cout<<i;return 0;}
Post your Comments and Discuss C++ Institute CPA-21-02 exam prep with other Community members:
Our website is free, but we have to fight against AI 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.