Search Placementyogi.com
 

C# Operators - Advanced Objective Questions

1

What is the output of the following program?

using System;
namespace PlacementYogi
{
    class Operators
    {
        public static void Main(String[] args) 
        {
            byte a1 = 0xF8;
            byte a2 = 0xAC;
            byte result;
            result = (byte)(a1 & a2);
            Console.Write(result + " ");
            result = (byte)(a1 ^ a2);
            Console.WriteLine(result);
        }
    }
}
A.

84 168

B.

168 84

C.

0 1

D.

None of the above

See Answer & Explanation Lets Discuss
Correct answer is : B
Explanation

No explanation available. Let's Discuss

 
2

What is the output of the following program?

using System;
namespace PlacementYogi
{
    class Operators
    {
        public static void Main(String[] args) 
        {
            byte a1 = 0xAB;
            byte a2 = 0x99;
            byte result;
            result = (byte)~a2;
            Console.Write(result + " ");
            result = (byte)(a1 << a2);
            Console.Write(result + " ");
            result = (byte)(a2 >> 3);
            Console.WriteLine(result);
        }
    }
}
A.

102 0 19

B.

102 1 19

C.

102 0 38

D.

1 0 1

See Answer & Explanation Lets Discuss
Correct answer is : A
Explanation

No explanation available. Let's Discuss

 
3

What is the output of the following program?

using System;
namespace PlacementYogi
{
    class Operators
    {
        public static void Main(String[] args) 
        {
            int x = 1, y = 2, z = 3;
            int result = x < y ? x < z ? z : x : y;
            Console.WriteLine(result);
        }
    }
}
A.

1

B.

2

C.

3

D.

Compilation Error

See Answer & Explanation Lets Discuss
Correct answer is : C
Explanation

No explanation available. Let's Discuss

 
 

Banner to LogicGuns.com

Hide Page Information

C# Operators - Advanced Objective Questions and Answers with Explanation

Here you can find advanced level C# operators interview questions with answers and explanation.

Why Operators in C#?

In this section you can learn and practice different types of operators (Advanced Level Questions with Answers) to improve your skills in order to face the interviews, competitive examinations and various entrance tests (CAT, GATE, GRE, MAT, Bank Exam etc.) with full confidence.

Where can I get C# Operators Advanced Questions and Answers with Explanation?

PlacementYogi provides you lots of fully solved advanced level Operators questions and answers with explanation. Fully solved examples with detailed answer description, explanation are given and it would be easy to understand. All students, freshers can download Operators quiz questions with answers as PDF files and eBooks.

Where can I get Advanced Level C# Operators Interview Questions and Answers (objective type, multiple choice)?

Here you can find objective type Advanced Operators questions and answers for interview and entrance examination. Multiple choice and TRUE or FALSE type and YES or NO type questions are also provided.