adplus-dvertising
frame-decoration

Question

Select the relevant output for the following set of code :
static void Main(string[] args)
 {
     byte varA = 10;
     byte varB = 20;
     long result = varA & varB;
     Console.WriteLine("{0}  AND  {1} Result :{2}", varA, varB, result);
     varA = 10;
     varB = 10;
     result = varA & varB;
     Console.WriteLine("{0}  AND  {1} Result : {2}", varA, varB, result);
     Console.ReadLine();
 }

a.

0, 20

b.

10, 10

c.

0, 10

d.

0, 0

Posted under C# programming

Answer: (c).0, 10

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Select the relevant output for the following set of code :

Similar Questions

Discover Related MCQs

Q. Select the relevant output for the set of code :

m = 5;
int y;
1. y = m++;
2. y = ++m;

Q. Which of the following is/are not Relational operators in C#.NET ?

Q. The correct way of incrementing the operators are :

Q. Correct order of priorities are :

Q. Disadvantages of Explicit Conversion are ?

Q. Type of Conversion in which compiler is unable to convert the datatype implicitly is ?

Q. Subset of ‘int’ datatype is :

Q. Implicit Conversion' follows the order of conversion as per compatibility of datatype as :

Q. Types of ‘Data Conversion’ in C#?

Q. What is the need for ‘Conversion of data type’ in C#?

Q. Select differences between reference type and value type :

1. Memory allocated to ‘Value type’ is from heap and reference type is from ‘System. ValueType’
2. Memory allocated to ‘Value type’ is from ‘System. ValueType’ and reference type is from ‘Heap’
3. Structures, enumerated types derived from ‘System. ValueType’ are created on stack, hence known as ValueType and all ‘classes’ are reference type because values are stored on heap

Q. Choose effective differences between ‘Boxing’ and ‘Unboxing’.

Q. Syntax for declaration and initialization of data variable is :

Q. Scope of variable is related to definition of variable as:

a. Region of code within which variable value is valid and hence can be accessed.
b. No, relation with region where variable is declared its value is valid in entire scope.

Q. Are the given codes :

1. Myclass class;
Myclass class2 = null;
2. int i;
int j = 0;

Q. DIFFERENCE BETWEEN KEYWORDS ‘VAR’ AND ‘DYNAMIC’ ?

Q. Storage location used by computer memory to store data for usage by an application is ?

Q. Why strings are of reference type in C#.NET ?

Q. Verbatim string literal is better used for ?

Q. Correct statement about strings are ?