1.For the given set of code, select the correct option from the following statements. static void Main(string[] args) { int num1 = 50; int num2 = 100; long total; total = num1 + num2; Console.WriteLine("Total is : " +total); Console.ReadLine(); } A) Compiler will throw runtime error B) No error generation since the conversion is implicit type C) To solve the problem we need to specify the datatype conversion externally D) None of the mentioned View Answer Report DiscussAnswer: Option BExplanation:Since 'int' is a subset of 'long' datatype, explicit conversion is not neededOutput: Total is : 150.
2.What are the types of ‘Data Conversion’ in C#? A) Implicit Conversion B) Explicit Conversion C) Implicit and Explicit Conversion D) None of the mentioned View Answer Report DiscussAnswer: Option B Explanation:Currently no explanation available Improve this answer lets discuss in forum
3.Why we need to convert a data type in C#? A) To store one data type value into a variable of another data type B) To get desired data C) To avoid run time error during change or conversion of data type D) None of the mentioned View Answer Report DiscussAnswer: Option C Explanation:Currently no explanation available Improve this answer lets discuss in forum
4.Select the wrong statement about structures in C#.NET? A) Structures can be declared within a procedure B) Structures cannot inherit from another structure but they can implement an interface C) Structure members cannot be decorated with protected access specifier D) A structure cannot be empty View Answer Report DiscussAnswer: Option A Explanation:Currently no explanation available Improve this answer lets discuss in forum
5.Select the correct statement from the following, why structures are defined as value types but not reference types? A) Structures are allocated on stack. B) Structures consists of small amount of data in them. Hence using stack for declaration of such variables is not a problem. C) All of the mentioned. D) None of the mentioned. View Answer Report DiscussAnswer: Option C Explanation:Currently no explanation available Improve this answer lets discuss in forum