Cpp Programming 84 – Which of the following statements regarding inline functions is correct?
[B]. It slows down execution.[C]. It increases the code size.
[D]. Both A and C.
Answer: Option D
Answer: Option D
Compiler
[C].
Linker
[D].
main() function
Answer: Option B
Explanation:
No answer description available for this question.
#include
class India
{
public:
struct Bix
{
int x;
float y;
void Function(void)
{
y = x = (x = 4*4);
y = --y * y;
}
void Display()
{
cout<< y << endl;
}
}B;
}I;
int main()
{
I.B.Display();
return 0;
}
[A].0
[B].1
[C].-1
[D].Garbage value
Answer: Option A
#include
class Base
{
public:
int S, A, M;
Base(int x, int y)
{
S = y - y;
A = x + x;
M = x * x;
}
Base(int, int y = 'A', int z = 'B')
{
S = y;
A = y + 1 - 1;
M = z - 1;
}
void Display(void)
{
cout<< S << " " << A << " " << M << endl;
}
};
class Derived : public Base
{
int x, y, z;
public:
Derived(int xx = 65, int yy = 66, int zz = 67): Base(x)
{
x = xx;
y = yy;
z = zz;
}
void Display(int n)
{
if(n)
Base::Display();
else
cout<< x << " " << y << " " << z << endl;
}
};
int main()
{
Derived objDev;
objDev.Display(-1);
return 0;
}
[A].65 65 65
[B].65 66 67
[C].A A A
[D].A B C
Answer: Option A
#include
class IndiaBix
{
static int count;
public:
static void First(void)
{
count = 10;
}
static void Second(int x)
{
count = count + x;
}
static void Display(void)
{
cout<< count << endl;
}
};
int IndiaBix::count = 0;
int main()
{
IndiaBix :: First();
IndiaBix :: Second(5);
IndiaBix :: Display();
return 0;
}
[A].0
[B].5
[C].10
[D].15
Answer: Option D
Answer: Option D
#include
class Bix
{
public:
int x;
};
int main()
{
Bix *p = new Bix();
(*p).x = 10;
cout<< (*p).x << " " << p->x << " " ;
p->x = 20;
cout<< (*p).x << " " << p->x ;
return 0;
}
[A].10 10 20 20
[B].Garbage garbage 20 20
[C].10 10 Garbage garbage
[D].Garbage garbage Garbage garbage
Answer: Option A