Which of the following statements is correct about the C#.NET code snippet given below?
[A].
[B].
[C].
[D].
Answer: Option B
Explanation:
No answer description available for this question.
[B].
[C].
[D].
Answer: Option B
Explanation:
No answer description available for this question.
Answer: Option C
copy constructor
[C].
Both A and B
[D].
None of these
Answer: Option A
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
Friend function
[C].
Default constructor
[D].
const function
Answer: Option C
Explanation:
No answer description available for this question.
Answer: Option D
#include
class IndiaBix
{
public:
int x, y;
IndiaBix(int xx = 10, int yy = 20)
{
x = xx;
y = yy;
}
void Exchange(int *, int *);
};
int main()
{
IndiaBix objA(30, 40);
IndiaBix objB(50);
objA.Exchange(&objA.x, &objB.y);
cout<< objA.x << " " << objB.y << endl;
return 0;
}
void IndiaBix::Exchange(int *x, int *y)
{
int t;
t = *x;
*x = *y;
*y = t ;
}
[A].20 10
[B].30 20
[C].20 30
[D].30 40
Answer: Option C