C MCQ Quiz Hub

Choose a topic to test your knowledge and improve your C skills

1. Which of the following statements are TRUE about the .NET CLR? 1. It provides a language-neutral development & execution environment. 2. It ensures that an application would not be able to access memory that it is not authorized to access. 3. It provides services to run "managed" applications. 4. The resources are garbage collected. 5. It provides services to run "unmanaged" applications.




2. Which of the following are valid .NET CLR JIT performance counters? 1. Total memory used for JIT compilation 2. Average memory used for JIT compilation 3. Number of methods that failed to compile with the standard JIT 4. Percentage of processor time spent performing JIT compilation 5. Percentage of memory currently dedicated for JIT compilation




3. Which of the following statements is correct about Managed Code?




4. Which of the following are NOT true about .NET Framework? 1. It provides a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely. 2. It provides a code-execution environment that minimizes software deployment and versioning conflicts. 3. It provides a code-execution environment that promotes safe execution of code, including code created by an unknown or semi-trusted third party. 4. It provides different programming models for Windows-based applications and Web-based applications. 5. It provides an event driven programming model for building Windows Device Drivers.




5. Which of the following .NET components can be used to remove unused references from the managed heap?




6. Which of the following constitutes the .NET Framework? 1. ASP.NET Applications 2. CLR 3. Framework Class Library 4. WinForm Applications 5. Windows Services




7. Which of the following assemblies can be stored in Global Assembly Cache?




8. https://mcqmate.com/topic/956/c-programming/unit-1-set-1#:~:text=Code%20that%20targets%20the%20Common%20Language%20Runtime%20is%20known%20as




9. Which of the following benefits do we get on running managed code under CLR? 1. Type safety of the code running under CLR is assured. 2. It is ensured that an application would not access the memory that it is not authorized to access. 3. It launches separate process for every application running under it. 4. The resources are Garbage collected.




10. Which of the following jobs are done by Common Language Runtime? 1. It provides core services such as memory management, thread management, and remoting. 2. It enforces strict type safety. 3. It provides Code Access Security. 4. It provides Garbage Collection Services.




11. Which of the following statements are correct about a .NET Assembly? 1. It is the smallest deployable unit. 2. Each assembly has only one entry point - Main(), WinMain() or DLLMain(). 3. An assembly can be a Shared assembly or a Private assembly. 4. An assembly can contain only code and data. 5. An assembly is always in the form of an EXE file.




12. Which of the following statements are correct about JIT? 1. JIT compiler compiles instructions into machine code at run time. 2. The code compiler by the JIT compiler runs under CLR. 3. The instructions compiled by JIT compilers are written in native code. 4. The instructions compiled by JIT compilers are written in Intermediate Language (IL) code. 5. The method is JIT compiled even if it is not called




13. Which of the following are parts of the .NET Framework? 1. The Common Language Runtime (CLR) 2. The Framework Class Libraries (FCL) 3. Microsoft Published Web Services 4. Applications deployed on IIS 5. Mobile Applications




14. In C#, a subroutine is called a ________.




15. All C# applications begin execution by calling the _____ method.




16. A _______ is an identifier that denotes a storage location




17. ________ are reserved, and cannot be used as identifiers.




18. Boxing converts a value type on the stack to an ______ on the heap.




19. The character pair?: is an________________available in C#.




20. In C#, all binary operators are ______.




21. An _______ is a symbol that tells the computer to perform certain mathematical orlogical manipulations.




22. A _____ is any valid C# variable ending with a colon.




23. C# has _______ operator, useful for making two way decisions.




24. _______causes the loop to continue with the next iteration after skipping any statementsin between.




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




26. Arrays in C# are ______ objects




27. Multidimensional arrays are sometimes called _______ Arrays.




28. Which of the following define the rules for .Net Languages?




29. _____ namespace is not defined in the .NET class library.




30. Dot Net Framework consists of :




31. Which of the following statements are correct about JIT? 1. JIT compiler compiles instructions into machine code at run time. 2. The code compiler by the JIT compiler runs under CLR. 3. The instructions compiled by JIT compilers are written in native code. 4. The instructions compiled by JIT compilers are written in Intermediate Language (IL) code.




32. Code that targets the Common Language Runtime is known as




33. How many types of compilers availbale under CLR?




34. Which of the following utilities can be used to compile managed assemblies into processor-specific native code?




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




36. What will be the output of the following code snippet when it is executed? int x = 1; float y = 1.1f; short z = 1; Console.Write.Line((float) x + y * z - (x += (short) y));




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




38. Which of the following statements are correct? 1. We can assign values of any type to variables of type object. 2. When a variable of a value type is converted to object, it is said to be unboxed. 3. When a variable of type object is converted to a value type, it is said to be boxed. 4. Boolean variable cannot have a value of null. 5. When a value type is boxed, an entirely new object must be allocated and constructed.




39. Which of the following can be used to terminate a while loop and transfer control outside the loop? 1. exit while 2. continue 3. exit statement 4. break 5. goto




40. Which of the following statements are correct about the C#.NET code snippet givenbelow? if (age > 18 && no < 11) a = 25; 1. The condition no < 11 will be evaluated only if age > 18 evaluates to True. 2. The statement a = 25 will get executed if any one condition is True. 3. The condition no < 11 will be evaluated only if age > 18 evaluates to False. 4. The statement a = 25 will get executed if both the conditions are True. 5. && is known as a short circuiting logical operator.




41. https://mcqmate.com/topic/956/c-programming/unit-2-set-1#:~:text=Which%20of%20the%20following%20is%20the%20correct%20output%20for%20the%20C%23.NET%20code%20snippet%20given%20below%3FConsole.WriteLine(13%20/%202%20%2B%20%22%20%22%20%2B%2013%20%25%202)%3B




42. Which of the following statements are correct? 1. Instance members of a class can be accessed only through an object of that class. 2. A class can contain only instance data and instance member function. 3. All objects created from a class will occupy equal number of bytes in memory. 4. A class can contain Friend functions. 5. A class is a blueprint or a template according to which objects are created.




43. Which of the following is the correct way to create an object of the class Sample? 1. Sample s = new Sample(); 2. Sample s; 3. Sample s; s = new Sample(); 4. s = new Sample();




44. Which of the following statements is correct?




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




46. Which one of the following statements is correct?




47. Which of the following statements are correct about arrays used in C#.NET? 1. Arrays can be rectangular or jagged. 2. Rectangular arrays have similar rows stored in adjacent memory locations. 3. Jagged arrays do not have an access to the methods of System.Array Class. 4. Rectangular arrays do not have an access to the methods of System.Array Class. 5. Jagged arrays have dissimilar rows stored in non-adjacent memory locations.




48. Which of the following statements are correct? 1. A struct can contain properties. 2. A struct can contain constructors. 3. A struct can contain protected data members. 4. A struct cannot contain methods. 5. A struct cannot contain constants.




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




50. Which of the following statements are correct about exception handling in C#.NET? 1 If an exception occurs then the program terminates abruptly without getting any chance to recover from the exception. 2 No matter whether an exception occurs or not, the statements in the finally clause (if present) will get executed. 3 A program can contain multiple finally clauses. 4 A finally clause is written outside the try block. 5 Finally clause is used to perform cleanup operations like closing the network/database connections.




51. _____ parameters are used to pass results back to the calling method.




52. The formal-parameter-list is always enclosed in _______.




53. ____ variables are visible only in the block they are declared.




54. C# does not support _____ constructors.




55. A structure in C# provides a unique way of packing together data of ______ types.




56. Struct’s data members are ____________ by default.




57. A _______ creates an object by copying variables from another object.




58. The methods that have the same name, but different parameter lists and differentdefinitions is called______.




59. The C# provides special methods known as _____ methods to provide access to data members.




60. Storage location used by computer memory to store data for usage by an application is ?