What would be the output of the following?


			  		

Loading

Practice Memory Management –

What would be the output of the following?

#include
void main()
{
char *ptr=“abcd”
char ch;
ch = ++*ptr++;
cout< }

What will be the output of the following program?

Loading

Practice Memory Management –

What will be the output of the following program?

#include  
int main() {
int x = 10, y = 20;
int *ptr = &x;
int &ref = y;
*ptr++;
ref++;
cout<< x << " " << y;
return 0;
}

What will be the output of the program?


			  		

Loading

Practice OOPS Concepts –

What will be the output of the program?

public class Test {      
public static void main (String[] args) {
String foo = args[1];
String bar = args[2];
String baz = args[3];
System.out.println("baz = " + baz); /* Line 8 */
}
}

And the command line invocation :-

java Test red green blue

What would be the output of the following program ?

Loading

Practice OOPS Concepts –

What would be the output of the following program ?

class test {
public static void main(String[] args) {
for(int i=0;i<=args.length;i++);
System.out.println(args[i]);
}
}

What will be the output of the following program?

Loading

Practice Operator Overloading –

What will be the output of the following program?

#include 
const double CrackexamsConstant(const int, const int = 0);
int main() {
const int c = 2 ;
cout<< CrackexamsConstant(c, 10)<< " ";
cout<< CrackexamsConstant(c, 20)<< endl;
return 0;
}
const double CrackexamsConstant(const int x, const int y) {
return( (y + (y * x) * x % y) * 0.2);
}

Which of the following statement is correct about the program given

Loading

Practice Operator Overloading –

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

#include 
long FactFinder(long = 5);
int main() {
for(int i = 0; i<= 0; i++)
cout<< FactFinder() << endl;
return 0;
}
long FactFinder(long x) {
if(x < 2) {
return 1;
}
long fact = 1;
for(long i = 1; i <= x-1; i++) {
fact = fact * i;
}
return fact;
}

What will be the output of the following program?

Loading

Practice Operator Overloading –

What will be the output of the following program?

#include 
int main() {
float Amount;
float Calculate(float P = 5.0, int N = 2, float R = 2.0);
Amount = Calculate();
cout<< Amount << endl;
return 0;
}
float Calculate(float P, int N, float R) {
int Year = 1;
float Sum = 1 ;
Sum = Sum * (1 + P * ++N * R);
Year = (int)(Year + Sum);
return Year;
}

What will be the output of the following program?

Loading

Practice Function Overloading –

What will be the output of the following program?

#include 
class Crackexams {
int x, y;
public:
void show(void);
void main(void);
};
void Crackexams::show(void) {
Crackexams b;
b.x = 2;
b.y = 4;
cout<< x << " " << y;
}
void Crackexams::main(void) {
Crackexams b;
b.x = 6;
b.y = 8;
b.show();
}
int main(int argc, char *argv[]) {
Crackexams run;
run.main();
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 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 Function Overloading –

What will be the output of the following program?

#include 
class Base {
int x, y;
public:
Base() {
x = y = 0;
}
Base(int xx) {
x = xx;
}
Base(int p, int q = 10) {
x = p + q;
y = q;
}
void Display(void) {
cout<< x << " " << y << endl;
}
objDefault(1, 1);
};
class Derived: public Base {
Base obj;
public:
Derived(int xx, int yy): Base(xx, xx + 1) { }
Derived(Base objB = objDefault) { }
};
int main() {
Derived objD(5, 3);
Derived *ptrD = new Derived(objD);
ptrD->Display();
delete ptrD;
return 0;
}

Which of the following statement is correct about the program given

Loading

Practice Function Overloading –

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

#include  
static int Result;
class India {
public:
void Change(int x = 10, int y = 20, int z = 30) {
cout<< x + y + z;
}
void Display(int x = 40, float y = 50.00) {
Result = x % x;
cout<< Result;
}
};
class Try {
int x, y;
public:
void Change(int x, int y = 50) {
cout<< x + y;
}
};
class Crackexams: public India, public Try {
public:
void Display(int x = 10, int xx = 100, int xxx = 1000) {
Result = x + xx % x * x;
cout<< Result ;
}
};
int main() {
Crackexams objTry;
objTry.India::Display(10, 20.00);
return 0;
}