What is the output of following program?


			  		

Loading

Practice Inheritance –

What is the output of following program?

#include
using namespace std;

class Base {};

class Derived: public Base {};

int main()
{
Base *bp = new Derived;
Derived *dp = new Base;
}

Find the output of following program?


			  		

Loading

Practice Function Overloading –

Find the output of following program?

#include
using namespace std;

class Base
{
public:
virtual void show() = 0;
};

int main(void)
{
Base b;
Base *bp;
return 0;
}

Find the output of following program?


			  		

Loading

Practice Memory Management –

Find the output of following program?

#include 
class Test
{
public:
void fun();
};
static void Test::fun()
{
std::cout<<"fun() is static ";
}
int main()
{
Test::fun();
return 0;
}

Predict the output of following program.


			  		

Loading

Practice Memory Management –

Predict the output of following program.

#include
using namespace std;

class Test
{
private:
static int count;
public:
Test& fun();
};

int Test::count = 0;

Test& Test::fun()
{
Test::count++;
cout << Test::count << " ";
return *this;
}

int main()
{
Test t;
t.fun().fun().fun().fun();
return 0;
}

What will be the output of the following program?

Loading

Practice OOPS Concepts –

What will be the output of the following program?

#include  
void MyFunction(int a, int b = 40) {
cout<< " a = "<< a << " b = " << b << endl;
}
int main() {
MyFunction(20, 30);
return 0;
}

What will be the output of the following program?

Loading

Practice OOPS Concepts –

What will be the output of the following program?

#include  
static int b = 0;
void DisplayData(int *x, int *y = &b) {
cout<< *x << " " << *y;
}
int main() {
int a = 10, b = 20 ;
DisplayData(&a, &b);
return 0;
}

What will be the output of the following program?

Loading

Practice Exception Handling –

What will be the output of the following program?

#include  
class Crackexams {
public:
void Try(int x = 15) {
x = x/2;
if(x > 0) {
Try();
}
else {
cout<< x % 2;
}
}
};
int main() {
Crackexams objIB;
objIB.Try();
return 0;
}

What will be the output of the following program?

Loading

Practice Functions –

What will be the output of the following program?

#include 
long GetNumber(long int Number) {
return --Number;
}
float GetNumber(int Number) {
return ++Number;
}
int main() {
int x = 20;
int y = 30;
cout<< GetNumber(x) << " ";
cout<< GetNumber(y) ;
return 0;
}

What will be the output of the following program?

Loading

Practice Functions –

What will be the output of the following program?

#include  
struct MyData {
public:
int Addition(int a, int b = 10) {
return (a *= b + 2);
}
float Addition(int a, float b);
};
int main() {
MyData data;
cout< cout< return 0;
}

What will be the output of the following program?

Loading

Practice Functions –

What will be the output of the following program?

#include
int CrackexamsTest(int x, int y);
int CrackexamsTest(int x, int y, int z = 5);
int main() {
cout << CrackexamsTest(2, 4) << endl;
return 0;
}
int CrackexamsTest(int x, int y) {
return x * y;
}
int CrackexamsTest(int x, int y, int z = 5) {
return x * y * z;
}

What will be the output of the following program?

Loading

Practice Exception Handling –

What will be the output of the following program?

#include  
class Crackexams {
public:
int a;
float b;
void TryFunction(int a, float b, float c = 100.0f) {
cout<< a % 20 + c * --b;
}
};
int main() {
Crackexams obj;
obj.TryFunction(20, 2.000000f, 5.0f);
return 0;
}

What will be the output of the following program?

Loading

Practice OOPS Concepts –

What will be the output of the following program?

#include 
void Tester(int xx, int yy = 5);
class Crackexams {
int x;
int y;
public:
void Tester(int xx, int yy = 5){
x = xx;
y = yy;
cout<< ++x % --y;
}
};
int main() {
Crackexams obj;
obj.Tester(5, 5);
return 0;
}

What will be the output of the following program?

Loading

Practice Objects and Classes –

What will be the output of the following program?

#include  
class PowerFinder {
public:
void Power(int x = 1, int y = 1) {
int P = 1, i = 1;
while(++i <= y) {
P *= x;
}
cout<< P << endl;
}
};
int main() {
PowerFinder FP;
FP.Power(2, 6);
return 0;
}