1. Which of the following will be the correct output for the C#.NET code snippet given below? enum color : int { red = -3, green, blue } Console.Write( (int) color.red + ", "); Console.Write( (int) color.green + ", "); Console.Write( (int) color.blue );






Write Comment

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

Tags
Show Similar Question And Answers
QA->As per Co-operative societies rule ‘Net profit’ means net profit as certified by :....
QA->A jar contains 10 red marbles and 30 green ones.How many red marbles must be added to the jar so that 60% of the marbles will be red?....
QA->Which chemical compound is also known in the names of "Prussian blue, Parisian Blue & Berlin Blue"?....
QA->In a certain code SUNDAY is coded as USDNYA. How could CREATION be written in that code?....
QA->The code name given to the electronic surveillance programme operated by US which is said to have direct access to the communication passed through Google, Facebook, Apple and many other internet companies?....
MCQ->Which of the following statements are correct about the C#.NET code snippet given below? namespace IndiabixConsoleApplication ( class Sample { private enum color : int { red, green, blue } public void fun() { Console.WriteLine(color.red); } } class Program { static void Main(string[ ] args) { // Use enum color here } } } To define a variable of type enum color in Main(), we should use the statement, color c; . enum color being private it cannot be used in Main(). We must declare enum color as public to be able to use it outside the class Sample. To define a variable of type enum color in Main(), we should use the statement, Sample.color c; . We must declare private enum color outside the class to be able to use it in Main().....
MCQ->What is the output of the C#.NET code snippet given below? namespace IndiabixConsoleApplication { public enum color { red, green, blue }; class SampleProgram { static void Main (string[ ] args) { color c = color.blue; switch (c) { case color.red: Console.WriteLine(color.red); break; case color.green: Console.WriteLine(color.green); break; case color.blue: Console.WriteLine(color.blue); break; } } } }....
MCQ->Which of the following will be the correct output for the C#.NET code snippet given below? enum color : int { red = -3, green, blue } Console.Write( (int) color.red + ", "); Console.Write( (int) color.green + ", "); Console.Write( (int) color.blue );....
MCQ->Which of the following is the correct output for the C#.NET code snippet given below? enum color: int { red, green, blue = 5, cyan, magenta = 10, yellow } Console.Write( (int) color.green + ", " ); Console.Write( (int) color.yellow );....
MCQ->Which of the following statements are correct about an enum used inC#.NET? To use the keyword enum, we should either use [enum] or System.Enum. enum is a keyword. Enum is class declared in System.Type namespace. Enum is a class declared in the current project's root namespace. Enum is a class declared in System namespace.....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use
DMCA.com Protection Status Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions