Which of the following statements are correct about the C#.NET code snippet given below?
[A].
[B].
[C].
[D].
Answer: Option A
Explanation:
No answer description available for this question.
[B].
[C].
[D].
Answer: Option A
Explanation:
No answer description available for this question.
A destructor has a different name than the class in which it is present.
[C].
A destructor always returns an integer.
[D].
A destructor can be overloaded.
Answer: Option A
Explanation:
No answer description available for this question.
Answer: Option D
#include
class BixData
{
int x, y, z;
public:
BixData(int xx, int yy, int zz)
{
x = ++xx;
y = ++yy;
z = ++zz;
}
void Show()
{
cout<< "" << x++ << " " << y++ << " " << z++;
}
};
int main()
{
BixData objData(1, 2, 3);
objData.Show();
return 0;
}
[A].The program will print the output 1 2 3.
[B].The program will print the output 2 3 4 .
[C].The program will print the output 4 5 6.
[D].The program will report compile time error.
Answer: Option B
#include
class Bix
{
int x, y;
public:
void show(void);
void main(void);
};
void Bix::show(void)
{
Bix b;
b.x = 2;
b.y = 4;
cout<< x << " " << y;
}
void Bix::main(void)
{
Bix b;
b.x = 6;
b.y = 8;
b.show();
}
int main(int argc, char *argv[])
{
Bix run;
run.main();
return 0;
}
[A].2 4
[B].6 8
[C].The program will report error on Compilation.
[D].The program will report error on Linking.
Answer: Option B
#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;
}
[A].The program will print the output 10 20.
[B].The program will print the output 10 0.
[C].The program will print the output 10 garbage.
[D].The program will report compile time error.
Answer: Option A
virtual function
[C].
destructor
[D].
main
Answer: Option A
Explanation:
No answer description available for this question.