C Programming Quiz

C Programming Quiz

 



C Programming Quiz contain set of 10 MCQ questions for C Programming MCQ which will help you to clear beginner level quiz.



1. Which of the following utilities can be used to compile managed assemblies into processor-specific native code?
A. gacutil
B. ngen
C. sn
D. dumpbin
2. Which of the following .NET components can be used to remove unused references from the managed heap?

A. Common Language Infrastructure
B. CLR
C. Garbage Collector
D. Class Loader

 
3. Which of the following are the correct ways to increment the value of variable a by 1?

  1. ++a++;
  2. a += 1;
  3. a ++ 1;
  4. a = a +1;
  5. a = +1;

A. 1, 3
B. 2, 4
C. 3, 5
D. 4, 5

 
4. Which of the following statements is correct?
A. A constructor can be used to set default values and limit instantiation.
B. C# provides a copy constructor.
C. Destructors are used with classes as well as structures.
D. A class can have more than one destructor.

 
5. The string built using the String class are immutable (unchangeable), whereas, the ones built- using the StringBuilder class are mutable.
A. True
B. False

 
6. Which of the following unary operators can be overloaded?

  1. true
  2. false
  3. +
  4. new
  5. is

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

 
7. Which of the following keyword is used to overload user-defined types by defining static member functions?
A. op
B. opoverload
C. operator
D. operatoroverload

 
8. A class implements two interfaces each containing three methods. The class contains no instance data. Which of the following correctly indicate the size of the object created from this class?
A. 12 bytes
B. 24 bytes
C. 0 byte
D. 8 bytes

 
9. Which of the following statements is correct about Interfaces used in C#.NET?
A. All interfaces are derived from an Object class.
B. Interfaces can be inherited.
C. All interfaces are derived from an Object interface.
D. Interfaces can contain only method declaration.

 
10. 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.