What will be the output of the program?#include <iostream>using namespace std;int fun(int);int main(){cout << fun(5);return 0;}int fun(int i){return i*i;}
Answer(s): A
What happens when you attempt to compile and run the following code?#include <iostream>using namespace std;#define FUN(arg) if(arg) cout<<"Test";int main(){int i=1;FUN(i<3);return 0;}
Answer(s): D
What will the variable "y" 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 main(){float x=3.5,y=1.6;int i,j=2;i = x + j + y;cout << i;return 0;}
What happens when you attempt to compile and run the following code?#include <iostream>using namespace std;int main(){int i = 1;if (i==1) {cout << i;} else {cout << i-1;}return 0;}
Post your Comments and Discuss C++ Institute CPA-21-02 exam prep with other Community members: