.NET Programming Solved MCQs

1.

A variable which is declared inside a method is called a________variable

A. Serial
B. Local
C. Private
D. Static
Answer» B. Local
2.

Which is the String method used to compare two strings with each other ?

A. Compare To()
B. Compare()
C. Copy()
D. ConCat()
Answer» B. Compare()
3.

Minimum and Maximum range of values supported by ‘float’ data type are ?

A. 1.5 * 10 ^-40 to 3.4 * 10 ^38
B. 1.5 * 10 ^-45 to 3.4 * 10 ^30
C. 1.5 * 10 ^-45 to 3.4 * 10 ^38
D. 1.5 * 10 ^-45 to 3.4 * 10 ^37
Answer» C. 1.5 * 10 ^-45 to 3.4 * 10 ^38
4.

Which datatype should be more preferred for storing a simple number like 35 to improve execution speed of a program?

A. sbyte
B. short
C. int
D. long
Answer» A. sbyte
5.

What will be output of the following conversion ?
static void Main(string[] args)
{
char a = 'A';
string b = "a";
Console.WriteLine(Convert.ToInt32(a));
Console.WriteLine(Convert.ToInt32(Convert.Tochar(b)));
Console.ReadLine();
}

A. 1, 97
B. 65, 97
C. 65, 97
D. 97, 1
Answer» C. 65, 97
6.

Scope of variable is related to definition of variable as:
1. Region of code within which variable value is valid and hence can be accessed.
2. No, relation with region where variable is declared its value is valid in entire scope.

A. a
B. b
C. a, b
D. None of the mentioned
Answer» A. a
7.

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

A. ushort to long
B. int to uint
C. ushort to long
D. byte to decimal
Answer» B. int to uint
8.

Select output of the given set of Code :
static void Main(string[] args)
{
String name = "Dr.Gupta";
Console.WriteLine("Good Morning" + name);
}

A. Dr.Gupta
B. Good Morning
C. Good Morning Dr.Gupta
D. Good Morning name
Answer» C. Good Morning Dr.Gupta
9.

Which of the following is an 8-byte Integer?

A. Char
B. Long
C. Short
D. Byte
Answer» B. Long
10.

Which of the following is NOT an Integer?

A. Char
B. Byte
C. Integer
D. Short
Answer» A. Char
11.

Which of the following are value types?
1.Integer
2.Array
3.Single
4.String
5.Long

A. 1, 2, 5
B. 1, 3, 5
C. 2, 4
D. 3, 5
Answer» B. 1, 3, 5
12.

Which of the following does not store a sign?

A. Short
B. Integer
C. Long
D. Byte
Answer» D. Byte
13.

What is the size of a Decimal?

A. 4 byte
B. 8 byte
C. 16 byte
D. 32 byte
Answer» C. 16 byte
14.

Which of the following is the correct size of a Decimal datatype?

A. 8 Bytes
B. 4 Bytes
C. 10 Bytes
D. 16 Bytes
Answer» D. 16 Bytes
15.

Which of the following statements is correct?

A. When a class inherits an interface it inherits member definitions as well as its implementations.
B. An interface cannot contain the signature of an indexer.
C. Interfaces members are automatically public.
D. To implement an interface member, the corresponding member in the class must be public as well as static.
Answer» C. Interfaces members are automatically public.
16.

Which of the following can implement an interface?
1.Data
2.Class
3.Enum
4.Structure
5.Namespace

A. 1, 3
B. 2, 4
C. 3, 5
D. 4 only
Answer» B. 2, 4
17.

Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "ALL MEN ARE CREATED EQUAL";
String s2;
s2 = s1.Substring(12, 3);
Console.WriteLine(s2);

A. ARE
B. CRE
C. CR
D. REA
Answer» B. CRE
18.

If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two references?

A. s1 is s2
B. s1 = s2
C. s1.Equals(s2)
D. strcmp(s1, s2)
Answer» C. s1.Equals(s2)
19.

Which of the following is the correct output of the C#.NET code snippet given below?
int[ , , ] a = new int[ 3, 2, 3 ];
Console.WriteLine(a.Length);

A. 20
B. 4
C. 18
D. 10
Answer» C. 18
20.

Which of the following are NOT Relational operators in C#.NET?
1.>=
2.!=
3.Not
4.<=
5.<>=

A. 1, 3
B. 2, 4
C. 3, 5
D. 4, 5
Answer» C. 3, 5
21.

Which of the following is NOT an Assignment operator in C#.NET?

A. \=
B. /=
C. *=
D. +=
Answer» A. \=
22.

A GUI:

A. uses buttons, menus, and icons.
B. should be easy for a user to manipulate.
C. stands for Graphic Use Interaction.
D. Both a and b.
Answer» D. Both a and b.
23.

Visual Studio .NET provides which feature:

A. debugging.
B. application deployment.
C. syntax checking.
D. All of the above..
Answer» D. All of the above..
24.

What does IDE stand for?

A. Integrated Development Environment
B. Integrated Design Environment
C. Interior Development Environment
D. Interior Design Environment
Answer» A. Integrated Development Environment
25.

Which is not a main component of the Visual Studio IDE?

A. Solution Explorer
B. Tool Box
C. Start Menu
D. Designer Window
Answer» C. Start Menu
Tags
Question and answers in .NET Programming, .NET Programming multiple choice questions and answers, .NET Programming Important MCQs, Solved MCQs for .NET Programming, .NET Programming MCQs with answers PDF download

We need your help!

We're developing a website for study materials for students.
We would love to hear your answers to some of the questions.

Take Survey