What will be the output of the following program?

Loading

Practice OOPS Concepts –

What will be the output of the following program?

#include  
class Number {
int Num;
public:
Number(int x = 0) {
Num = x;
}
void Display(void) {
cout<< Num;
}
void Modify();
};
void Number::Modify() {
int Dec;
Dec = Num % 13;
Num = Num / 13;
if(Num > 0 ) {
Modify();
}
if(Dec == 10) {
cout<< "A" ;
}
else if(Dec == 11){
cout<< "B" ;
}
else if(Dec == 12) {
cout<< "C" ;
}
else if(Dec == 13) {
cout<< "D" ;
}
else {
cout<< Dec ;
}
}
int main() {
Number objNum(130);
objNum.Modify();
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 
class Crackexams {
int x, y, z;
public:
void Apply(int xx = 12, int yy = 21, int zz = 9) {
x = xx;
y = yy += 10;
z = x -= 2;
}
void Display(void) {
cout<< x << " " << y << endl;
}
void SetValue(int xx, int yy) {
Apply(xx, 0, yy);
}
};
int main() {
Crackexams *pCrackexams= new Crackexams;
(*pCrackexams).SetValue(12, 20);
pCrackexams->Display();
delete pCrackexams;
return 0;
}

Which of the following statement is correct about the program given

Loading

Practice OOPS Concepts –

Which of the following statement is correct about the program given below?

#include 
class Crackexams {
int x, y, z;
public:
Crackexams(int x = 100, int y = 30, int z = 0) {
this->x = x;
this->y = y;
this->z = z;
Display();
}
void Display() {
cout<< x << " " << y << " " << z;
}
};
int main() {
int a = 0, b = 1, c = 2;
int &x = ++a;
int &y = --b;
int z = c + b - -c;
Crackexams objCrackexams(x, y, z);
return 0;
}