B

Babita • 7.70K Points
Tutor III

Q. What will be the output of the following C# code?

Code:
class Program
 {
     public static void Main(string[] args)
     {
         int i, j;
         i = (j = 5) + 10;
         Console. WriteLine(i);
         Console. WriteLine(j);
         Console. ReadLine();
     }
 }
  • (A) 15, 15
  • (B) 10, 5
  • (C) 15, 5
  • (D) 10, 15
  • Correct Answer - Option(C)
  • Views: 170
  • Filed under category C#

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.

Related MCQs on C#

Q. In C#, structures are used for ___ objects such as mobiles, cars, etc.

Q. Which of the following can be facilitated by the Inheritance mechanism? 1 Use the existing functionality of base class. 2 Override the existing functionality of base class. 3 Implement new functionality in the derived class. 4 Implement polymorphic behaviour. 5 Implement containership.

Q. A copy of a database is called a

Q. Which of the following is the correct way to access all elements of the Queue collection created using the C#.NET code snippet given below Queue q = new Queue(); q.Enqueue("Sachin"); q.Enqueue('A'); q.Enqueue(false); q.Enqueue(38); q.Enqueue(5.4);

Q. ______ parameters are used to pass results back to the calling method.

Q. Which of the following statements are correct about data types? 1. If the integer literal exceeds the range of byte, a compilation error will occur. 2. We cannot implicitly convert non-literal numeric types of larger storage size to byte. 3. Byte cannot be implicitly converted to float. 4. A char can be implicitly converted to only int data type. 5. We can cast the integral character codes.

Q. An ____ is a group of contiguous or related data items that share a common name.

Q. Which of the following statements are correct about data types? 1. If the integer literal exceeds the range of byte, a compilation error will occur. 2. We cannot implicitly convert non-literal numeric types of larger storage size to byte. 3. Byte cannot be implicitly converted to float. 4. A char can be implicitly converted to only int data type. 5. We can cast the integral character codes.

Q. Which of the following statements is correct about the C#.NET code snippet given below? class Student s1, s2; // Here 'Student' is a user-defined class. s1 = new Student(); s2 = new Student();

Q.

Learn All C# MCQs


Question analytics