MCQs | C/NET Programming mcqs Sample Test,Sample questions

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

1.1.5 * 10 ^-40 to 3.4 * 10 ^38

2.1.5 * 10 ^-40 to 3.4 * 10 ^38

3.1.5 * 10 ^-45 to 3.4 * 10 ^38

4.1.5 * 10 ^-45 to 3.4 * 10 ^37


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

1.Compare To()

2.Compare()

3.Copy()

4.ConCat()


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

1. 1, 3

2.2, 4

3. 3, 5

4.4 only


Question:
Which of the following statements is correct?

1. When a class inherits an interface it inherits member definitions as well as its implementations.

2.An interface cannot contain the signature of an indexer.

3.Interfaces members are automatically public.

4.To implement an interface member, the corresponding member in the class must be public as well as static.


Question:
A variable which is declared inside a method is called a________variable

1.Serial

2.Local

3.Private

4.Static


Question:
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.

1.a

2.b

3.a, b

4.None of the mentioned


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

1.r4r

2.Good Morning

3.Good Morning r4r

4.Good Morning name


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

1. ushort to long

2.int to uint

3.ushort to long

4.byte to decimal


Question:
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();
}

1.1, 97

2. 65, 97

3. 65, 97

4.97, 1


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

1.sbyte

2.short

3.int

4.long


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

1.1, 2, 5

2.1, 3, 5

3.2, 4

4.3, 5


Question:
Which of the following is NOT an Integer?

1.Char

2.Byte

3.Integer

4.Short


More MCQS

  1. C# MCQS -Programming (.NET Framework)
  2. C# MCQS -Programming(Control Instructions)
  3. C# MCQS - Functions and Subroutines(.NET Framework)
  4. C# Programming-Constructors
  5. C# Programming- Arrays
  6. C# Programming -Structures
  7. C# Programming-Properties
  8. C# Programming -Exception Handling
  9. C# Programming -Interfaces
  10. C# Programming -Delegates
  11. C# Programming -Generics
  12. C# Programming - Datatypes
  13. C# Programming- Operators
  14. C# Programming -Classes and Objects
  15. NET Programming mcqs
  16. Computer Science Engineering (CSE) .NET Programming
  17. C# Programming Mcq Set 1
  18. C# Programming Mcq Set 2
  19. C#.NET Programming Mcq
Search