Question Set

1. Which of the following code snippets are the correct way to determine whether a is Odd or Even? int a; String res; if (a % 2 == 0) res = "Even"; else res = "Odd"; int a; String res; if (a Mod 2 == 0) res = "Even"; else res = "Odd"; int a; Console.WriteLine(a Mod 2 == 0 ? "Even": "Odd"); int a; String res; a % 2 == 0 ? res = "Even" : res = "Odd"; Console.WriteLine(res);






Ask Your Doubts Here

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

Comments

Show Similar Question And Answers
QA->The teacher asked him whether he _____ give him the correct answer.....
QA->A statement followed by two assumptions I and II is given. You have to consider the statement to be true even if it seems to be at variance from commonly known facts. You are to decide which of the given assumptions can definitely be drawn from the given statement. Indicate which one of the four given alternatives is correct ? Statement : If more encouragement is given to Sports, Indians will win more gold medals at the Olympic Games. Assumptions : I. Indians do not win gold medals. II. More enc....
QA->A pendulum clock is set to give correct time at the sea level. This clock is moved to a hill station at an altitude of 2500m above the sea level. In order to keep correct time on the hill station, the length of the pendulum?....
QA->In a secret way of writing COME AT ONCE FATHER VERY ILL is written as XLNV ZG LMXY UYGSVI EVIB ROO.Bearing this in mind pick up the code from the answer choices for the word given below: FIT AND WELL....
QA->The program that monitors users activity on internet and transmit that information in background to somewhere else is termed as....
MCQ->Which of the following code snippets are the correct way to determine whether a is Odd or Even? int a; String res; if (a % 2 == 0) res = "Even"; else res = "Odd"; int a; String res; if (a Mod 2 == 0) res = "Even"; else res = "Odd"; int a; Console.WriteLine(a Mod 2 == 0 ? "Even": "Odd"); int a; String res; a % 2 == 0 ? res = "Even" : res = "Odd"; Console.WriteLine(res);....
MCQ->What will be the output of the C#.NET code snippet given below? namespace IndiabixConsoleApplication { class SampleProgram { static void Main(string[ ] args) { int i; int res = fun(out i); Console.WriteLine(res); } static int fun (out int i) { int s = 1; i = 7; for(int j = 1; j <= i; j++) { s = s j; } return s; } } }....
MCQ->What will be the output of the C#.NET code snippet given below? namespace IndiabixConsoleApplication { class Sample { public static void fun1() { Console.WriteLine("Bix1 method"); } public void fun2() { fun1(); Console.WriteLine("Bix2 method"); } public void fun2(int i) { Console.WriteLine(i); fun2(); } } class MyProgram { static void Main(string[ ] args) { Sample s = new Sample(); Sample.fun1(); s.fun2(123); } } }....
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 snippets are the correct way to convert a Single into a String? Single f = 9.8f; String s; s = (String) (f); Single f = 9.8f; String s; s = Convert.ToString(f); Single f = 9.8f; String s; s = f.ToString(); Single f = 9.8f; String s; s = Clnt(f); Single f = 9.8f; String s; s = CString(f);....
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 | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution