AppsDev Chapter 2 - 5

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

B. False

A function returns a value, whereas a subroutine cannot return a value. A. True B. False

A. TextBox

Assume that you are designing a form and it will be necessary for the user to type in his name. You should use a _____________ for inputting the user's name. A. TextBox B. Label C. Button D. CheckBox

C. radio buttons

Assume that you are designing a form where the user will need to select only one item from a group of displayed choices. This can best be accomplished by using _______. A. check boxes B. text boxes C. radio buttons D. name boxes

C. setting the object's ToolTip on ToolTip1 property

Small labels that pop up when the user pauses the mouse pointer over a control on the form are created by _______. A. using the Focus method B. changing the object's Text property to True C. setting the object's ToolTip on ToolTip1 property D. setting the object's Value property to True

B. the Enter key

Setting the AcceptButton property of a form to a button name will cause the code in that button to be executed when the user presses _______. A. the Esc key B. the Enter key C. the Home key D. the Tab key

A. 11001

What does the following function displays for n=25;? public static void fun(int n) { if(n==0) return; Console.Write("{0}",n%2); fun(n/2); } A. 11001 B. 10011 C. 11111 D. 10101

B. blue

What is the output of the C#.NET code snippet given below? 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; } } } A. red B. blue C. 1 D. 2

D. 0,2

What is the output of the code below? public enum WeekDays{Monday, Tuesday, Wednesday} public static void Main(){ Console.Write((int)WeekDays.Monday + "," ); Console.Write((int)WeekDays.Wednesday); } A. 0, 1 B. Monday, Wednesday C. 1,Wednesday D. 0,2

C. 111

What is the output of the following code snippet? int n ; double x =12345.6; for(n=1; n*n <=x; n++) ; Console.Write("{0}", n-1); A. 110 B. 110. 11075 C. 111 D. 111.11075

C. ......*...... ....***.... ..*****.. *******

What is the output of the following code? const int N = 4; for (int i = 0; i < N; i++) { for (int j=0 ; j<2*N;j++) if(j<N-i||j>N+i) Console .Write (" "); else Console .Write ("*"); Console .WriteLine (); } (FOCUS SA ASTERISKS, AND DOTS KAY SPACE NA) A. ...........* ........*** ....***** ******* B. ******* ..*****.. ....***.... ......*...... C. ......*...... ....***.... ..*****.. ******* D. * *** ***** *******

C. 16 byte

What is the size of a Decimal data type? A. 4 byte B. 8 byte C. 16 byte D. 32 byte

B. 5

What is the value of iCounter after normal completion? for (iCounter = 5 ; iCounter <= 1; iCounter-=1) A. 0 B. 5 C. 6 D. 7

D. 25, 36

What will be the output of the C#.NET code snippet given below? public static void Main(string[] args) { int j, i = 5; fun1(ref i); fun2(out j); Console.WriteLine(i + ", " + j); } public static void fun1(ref int x) { x = x * x; } public static void fun2(out int x) { x = 6; x = x * x; } A. 5, 6 B. 5, 36 C. 25, 0 D. 25, 36

C. 1 4 Eivan

What will be the output of the C#.NET code snippet given below? public static void Main(string[] args) { object[] o = new object[] {"1", 4.0, "Eivan", 'B'}; fun(o); } public static void fun(params object[] obj) { for (int i = 0; i < obj.Length-1; i++) Console.Write(obj[i] + " "); } A. 1 4.0 Eivan B. 1 4.0 Eivan C. 1 4 Eivan D. 1 4 Eivan B

C. 102 0 38

What will be the output of the C#.NET code snippet given below? byte b1 = 0xAB, b2 = 0x99; Console.Write((byte)~b2 + " "); Console.Write ((byte)(b1 << b2) + " "); Console.WriteLine((byte) (b2 >> 2)); A. 102 1 38 B. 108 0 32 C. 102 0 38 D. 1 0 1

A. 163 92

What will be the output of the C#.NET code snippet given below? byte b1 = 0xF7, b2 = 0xAB; Console.Write ((byte)(b1 & b2) + " "); Console.WriteLine((byte)(b1^b2)); A. 163 92 B. 92 163 C. 192 63 D. 0 1

C. case D | case d

What will be the output of the C#.NET code snippet given below? char ch = Convert.ToChar ('a' | 'b' | 'c'); switch (ch) { case 'A': case 'a': Console.WriteLine ("case A | case a"); break; case 'B':case 'b': Console.WriteLine ("case B | case b"); break; case 'C':case 'c': case 'D':case 'd': Console.WriteLine ("case D | case d"); break; } A. case A | case a B. case B | case b C. case D | case d D. Compile Error

C. 30

What will be the output of the C#.NET code snippet given below? int a = 10, b = 20, c = 30; Console.WriteLine(a < b ? a < c ? c : a : b); A. 10 B. 20 C. 30 D. 0

B. 4 8 12 16 20

What will be the output of the C#.NET code snippet given below? int i, j = 1, k; for (i = 0; i < 5; i++) { k = j++ + ++j; Console.Write(k + " "); } A. 8 4 16 12 20 B. 4 8 12 16 20 C. 4 8 16 32 64 D. 2 4 6 8 10

D. 7 7

What will be the output of the C#.NET code snippet given below? int num = 1, z = 5; if (!(num <= 0)) Console.WriteLine( ++num + z++ + " " + ++z ); else Console.WriteLine( --num + z-- + " " + --z ); A. 5 6 B. 6 5 C. 6 6 D. 7 7

D. Byte

Which of the following does not store a sign? A. Short B. Integer C. Long D. Byte

A. MessageLabel.Text = MessageLabel.Text + " " + NameTextBox.Text

Which of the following is a valid example of concatenation? A. MessageLabel.Text = MessageLabel.Text + " " + NameTextBox.Text B. WeatherReportLabel.Text = Today's weather will be + WeatherTextBox.Text C. CityAndStateLabel.Text = CityTextBox.Text AND StateTextBox.Text D. "Good Morning, " & NameTextBox.Text = GreetingLabel.Tex

A. Long

Which of the following is an 8-byte integer? A. Long B. Short C. Byte D. Integer

D. DoSomething(10.0,11.1,12.2);

Which of the following is an INCORRECT method call? public static void Main(String[] args) { int[] ar = new int[3] { 1,2,3}; ______________ // method call here } public static void DoSomething(params int []item) { foreach(int i in item) Console .WriteLine (i); } A. DoSomething(ar); B. DoSomething(new int[]{4,5,6}); C. DoSomething(7,8,9); D. DoSomething(10.0,11.1,12.2);

C. MaskedTextBox

Which of the following is the best choice when the user needs to input her social security number? A. RichTextBox B. TextBox C. MaskedTextBox D. GroupBox

D. 6 1

Which of the following is the correct output for the C#.NET code snippet given below? Console.WriteLine(13 / 2 + " " + 13 % 2); A. 6.5 1 B. 6.5 0 C. 6 0 D. 6 1

C. 10 6 2 -2 -6 -10 -14

Which of the following is the correct output for the C#.NET program given below? int i = 10 ; for( ; ; ) { Console.Write(i + " "); if (i >= -10) i -= 4; else break; } A. 10 6 2 0 -2 -4 B. 10 6 2 0 -2 C. 10 6 2 -2 -6 -10 -14 D. 10 6 2 -2 -6 -10

B. const float pi = 3.14F;

Which of the following is the correct way to set an unmodifiable value 3.14 in a variable pi? A. float pi = 3.14F; B. const float pi = 3.14F; C. const float pi; D. pi = 3.14F;

C. LabelName.Visible = CheckBoxName.Checked

Which of the following makes the visibility of the label match the setting in the check box? A. CheckBoxName.Enabled = LabelName.Visible B. LabelName.Checked = CheckBoxName.Visible C. LabelName.Visible = CheckBoxName.Checked D. CheckBoxName.Checked=LabelName.Visible

C. c=(int)a + (int)b;

Which of the following statement correctly assigns a value 33 to a variable c? Assume byte a = 11, b = 22, c; A. c=(byte) (a + b); B. c=(byte)a + (byte)b; C. c=(int)a + (int)b; D. c=(int)(a + b);

A. RichTextBox

A control used for the user to type a brief summary of his work experience and allow formatting options and multiple lines. The best control for this task would be a _______. A. RichTextBox B. TextBox C. MaskedTextBox D. GroupBox

A. Check boxes

A hair-styling salon needs help designing a form for the various services that they offer. What would you suggest they use that will display all of the services, and that will allow the customers to choose one or more items? A. Check boxes B. Text boxes C. Radio buttons D. Rich text box

B. a value type which contains a set of named constants

An enumerator is ________________________. A. a type which can store a set of string constants B. a value type which contains a set of named constants C. stores a series of related data which can be modified later D. a type which can store data members as well as behaviors

B. 12, 2, 12, 12,

Assume the following code is embedded in a complete program. What will be the correct output? public static void Main(string[] args) { int num = 2; func1(num); Console.Write(num + ", "); func2(ref num); Console.Write(num + ", "); } public static void func1(int num) { num = num + 10; Console.Write(num + ", "); } public static void func2 (ref int num) { num = num + 10; Console.Write(num + ", "); } A. 2, 2, 2, 2, B. 12, 2, 12, 12, C. 12, 12, 12, 12, D. 12, 12, 22, 22,

A. 1 2 3 4

Assume the following code is embedded into a complete program. What is the output? int i = 0, j = 0; label: i++; j+=i; if (i < 5){ Console.Write(i + " "); goto label; } A. 1 2 3 4 B. 0 1 2 3 4 C. 2 3 4 D. 2 3 4 5

A. ampersand (&)

Create keyboard access on an object by using ______________ in the Text property. A. ampersand (&) B. at (@) C. underscore ( _ ) D. uppercase

B. x^y

Given the code below, what does Fun2() do in general? public static int Fun(int x, int y) { return (y==0)? 0: x + Fun(x,y-1); } public static int Fun2(int a, int b) { if(b==0) return 1; else return Fun(a,Fun2(a,b-1)); } A. x*y B. x^y C. y^x D. x^2

D. n(n+1)/2

How many stars will the following code output for a given positive value of n? public static void fun(int n) { int i=0; if (n>1) fun(n-1); for (i=0;i<n;i++) Console.Write("*"); } A. n B. n2 - 1 C. n(n-1)/2 D. n(n+1)/2

C. 8

How many times the body of the loop is executed? int iCounter = 1; while (iCounter < = 15 ){ sum= sum + iCounter * iCounter; iCounter = iCounter + 2; } A. 6 B. 7 C. 8 D. 9

A. 1

How many values a function capable of returning? A. 1 B. 0 C. Depends upon how many params arguments does it use. D. Any number E. Depends upon how many ref arguments does it use.

E. 1

How many values a subroutine capable of returning? A. Depends upon how many params arguments does it use. B. Any number of values. C. Depends upon how many ref arguments does it use. D. 0 E. 1

A. Checked

If a radio button is currently selected, its _______ property will be True. A. Checked B. Enabled C. Selected D. Visible

D. Visible, False

If you create a PictureBox that has a picture displayed during design time, but you don't want it to appear when the project runs, you must set the _______ property to ________. A. SizeMode, True B. Visible, True C. SizeMode, False D. Visible, False

A. SizeMode, StretchImage

In order to make a picture expand to fill an image control, you must set the ____ property to __. A. SizeMode, StretchImage B. Visible, True C. SizeMode, AutoSize D. Visible, False

D. TabIndex, 0

In order to make the insertion point appear in the object named UserInputTextBox when the form first appears, set the __ property to __ at design time. A. Focus , True B. TabStop, Focus C. TabIndex ,True D. TabIndex, 0

C. n = n & 0xF7

Suppose n is a variable of the type Byte and we wish to put OFF its fourth bit (from right) without disturbing any other bits. Which of the following statements will do this correctly? A. n = n && HF7 B. n = n & 8 C. n = n & 0xF7 D. n = n & 16

B. if ((n&8) == 8) Console.WriteLine("Third bit is ON");

Suppose n is a variable of the type Byte and we wish, to check whether its fourth bit (from right) is ON or OFF. Which of the following statements will do this correctly? A. if ((n&16) == 16) Console.WriteLine("Third bit is ON"); B. if ((n&8) == 8) Console.WriteLine("Third bit is ON"); C. if ((n ~ 8) == 8) Console.WriteLine("Third bit is ON"); D. if ((n ^ 8) == 8) Console.WriteLine("Third bit is ON");

C. check whether a bit is ON or OFF and put OFF a bit.

The Bitwise & operator can be used to ________________ A. check whether a bit is ON, invert and put ON a bit B. OFF, put ON and OFF C. check whether a bit is ON or OFF and put OFF a bit. D. put OFF and ON

B. put on a bit

The bitwise | operator can be used to ________________. A. put off a bit B. put on a bit C. invert a bit D. check whether a bit is ON E. check whether a bit is OFF

B. Fibonacci

The code snippet generates ___________ numbers series. int i = 1, j = 1, val=0; while (i < 25) { Console.Write(j + " "); val = i + j; j = i; i = val; } A. Prime B. Fibonacci C. Palindrome D. Odd

B. cause the NameTextBox control to have a white background

The code: NameTextBox.BackColor = Color.White, will _______. A. change the color of the border of the NameTextBox control to white B. cause the NameTextBox control to have a white background C. change the background color of the form to white D. change the text in the NameTextBox control to the color, white

D. All of the above

The items property of a ComboBox A. is a collection of items B. is the same as the Items property of a ListBox C. contains methods and properties D. All of the above

C. BorderStyle

The property of a label, text box, or picture box to make it appear to be three-dimensional or flat. A. 3D B. Fixed3D C. BorderStyle D. FixedSingle

C. Text

The property used to display information in a TextBox is _______. A. Caption B. Name C. Text D. Appearance

D. Image

The property used to display something in a PictureBox control is _______. A. Picture B. Name C. Text D. Image

B. Label control

To display text that cannot be modified by the user, use the _______. A. TextBox control B. Label control C. Caption control D. MaskedTextBox control

A. TextBox control

Use the _______ to display text that can be modified by the user. A. TextBox control B. Label control C. Caption control D. MaskedTextBox control

A. ......*...... ....***.... ..*****.. ******* ..*****.. ....***.... ......*......

What does the following program segment print? const int N = 3; for (int i = 0; i <= 2*N; i++) { for (int j=0 ; j<=2*N;j++) if (i <= N) if(j<N-i||j>N+i) Console .Write (" "); else Console .Write ("*"); else if (j < i-N || j > 3*N - i) Console.Write(" "); else Console.Write("*"); Console .WriteLine (); } (FOCUS SA ASTERISKS, AND DOTS KAY SPACE NA) A. ......*...... ....***.... ..*****.. ******* ..*****.. ....***.... ......*...... B. ......*...... ....***.... ..*****.. ******* ......*...... ....***.... ..*****.. C. ***.*** **.....** *.........* *.........* **.....** ***.*** D. ******* ..*****.. ....***.... ......*...... ....***.... ..*****.. *******

C. UUU Sharp CCC

What will be the output of the C#.NET code snippet given below? int val; for (val = -3; val <= 3; val++) { switch (val) { case 0: Console.Write (" Sharp "); break; } string result = (val > 0) ? "C" : (val < 0) ? "U" : ""; Console.Write(result); }//end for A. UUU Sharp B. Sharp CCC C. UUU Sharp CCC D.CCC Sharp UUU

C. 120

What will be the output of the C#.NET code snippet given below? public static void Main(string[] args) { int i; int res = fun(out i); Console.WriteLine(res); } public static int fun(out int i) { int s = 1; i = 5; for(int j = 1; j <= i; j++){ s = s * j; } return s; } A. 1 B. 8 C. 120 D. 720

C. 0 1 2 3 4 5

What will be the output of the code snippet given below? for(int i = 0; i<=5; i++) { if(i == 2) { Console.Write(i + " "); continue; } else if (i != 2) Console.Write(i + " "); else break; } A. 1 2 3 4 5 B. 1 2 3 4 C. 0 1 2 3 4 5 D. 4 5

A. 0.1

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.WriteLine((float) x + y * z - (x += (short) y)); A. 0.1 B. 1.0 C. 1.1 D. 11

A. 20 40 80 80 40 20

What will be the output of the following function call: fun(20); ? public static void fun(int n) { if(n>100) return; Console.Write("{0} " , n); fun(2*n); Console.Write("{0} " , n); } A. 20 40 80 80 40 20 B. 80 40 20 C. 20 40 80 80 60 40 20 D. 20 40 60 80

C. 13

What will be the output of the following function call: recFun(4,3);? private static int recFun(int x, int y) { return (x == 0)? y: recFun(x - 1, x + y); } A. 3 B. 7 C. 13 D. 14

B. be skipped when the user presses the Tab key

When a textBox control has a TabIndex lower than all of the other objects, it will _______. A. appear to the right of the other controls B. be skipped when the user presses the Tab key C. be aligned to the left of the other controls D. have the focus when the program begins running

D. 4, 5

Which of the following statements are correct about data types in C#.NET? 1. Value types are always created on the heap. 2. Reference types are always created on the stack. 3. Every reference type gets mapped to a type in CTS. 4. Every data type is either a value type or a reference type. 5. Mapping of every value type to a type in CTS facilitates interoperability in C#.NET. A. 1, 3 B. 2, 5 C.3, 4 D. 4, 5

D. 1, 2, 5

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. A char can be implicitly converted to only int data type. 4. Byte cannot be implicitly converted to float. 5. We can cast the integral character codes. A. 1, 3, 5 B. 2, 4 C. 3, 5 D. 1, 2, 5

D. 3, 4, 5

Which of the following statements are correct about functions and subroutines used in C#.NET? 1. A function cannot be called from a subroutine. 2. A subroutine cannot be called from a function. 3. Functions and subroutines can be called recursively. 4. The ref keyword causes arguments to be passed by reference. 5. While using ref keyword any changes made to the parameter in the method will be reflected in that variable when control passes back to the calling method. A. 1, 2, 4 B. 2, 3, 5 C. 1, 4, 5 D. 3, 4, 5

B. 2, 3, 5

Which of the following statements are correct about functions used in C#.NET? 1. Function calls can be nested. 2. Functions can be called recursively. 3. Function definitions cannot be nested. 4. If we do not return a value from a function then a value -1 gets returned. 5. To return the control from middle of a function exit function should be used. A. 3, 4, 5 B. 2, 3, 5 C. 1,2, 3 D. 1,4,5

C. 1, 4, 5

Which of the following statements are correct about the C#.NET code snippet given below? 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. A. 1, 3 B. 2, 5 C. 1, 4, 5 D. 3, 4, 5

C. It will output 125 125.

Which of the following statements are correct about the C#.NET program given below? class SampleProgram { public static void Main(string[] args) { int a = 5; int s = 0, c = 0; s=c= fun(a); Console.WriteLine(s +" " + c); } public static int fun(int x) { int ss, cc; ss = x * x; cc = x * x * x; return ss=cc; } } A. It will output 25 125. B. It will output 25 0. C. It will output 125 125. D. An error will be reported in the statement return ss=cc; since a function cannot return multiple values. E. An error will be reported in the statement s=c= fun(a); since multiple values returned from a function cannot be collected in this manner.

B. A value True will be assigned to c.

Which of the following statements are correct about the following code snippet? int a = 10; int b = 20; bool c = !(a > b); A. A value 1 will be assigned to c. B. A value True will be assigned to c. C. A value False will be assigned to c. D. An error will be reported since ! can work only with an int

A. 1, 2

Which of the following statements are correct? 1. A switch statement can act on numerical as well as Boolean types. 2. A switch statement can act on characters, strings and enumerations types. 3. We cannot declare variables within a case statement if it is not enclosed by { }. 4. The foreach statement is used to iterate through the collection to get the desired information and should be used to change the contents of the collection to avoid unpredictable side effects. 5. All of the expressions of the for statement are not optional. A. 1, 2 B. 2, 3 C. 3, 5 D. 4, 5

B. 2, 5

Which of the following statements are correct? 1. An argument passed to a ref parameter need not be initialized first. 2. Pass by reference eliminates the overhead of copying large data items. 3. Variables passed as out arguments need to be initialized prior to being passed. 4. To use a ref parameter only the calling method must explicitly use the ref keyword. 5. Argument that uses params keyword must be the last argument of variable argument list of a method. A. 1, 2 B. 2, 5 C. 3, 4 D. 4, 5

A. 1, 3, 5

Which of the following statements are correct? 1. C# allows a function to have arguments with default values. 2. C# allows a function to have variable number of arguments. 3. Redefining a method parameter in the method's body causes an exception. 4. Omitting the return value type in method definition results into an exception. 5. params is used to specify the syntax for a function with variable number of arguments. A. 1, 3, 5 B. 3, 4, 5 C. 2, 5 D. 4, 5

B.1, 3, 5

Which of the following statements are correct? 1. The switch statement is a control statement that handles multiple selections and enumerations by passing control to one of the case statements within its body. 2. The goto statement passes control to the next iteration of the enclosing iteration statement in which it appears. 3. Branching is performed using jump statements which cause an immediate transfer of the program control. 4. A common use of continue is to transfer control to a specific switch-case label or the default label in a switch statement. 5. The do statement executes a statement or a block of statements enclosed in {} repeatedly until a specified expression evaluates to false. A. 1, 2, 4 B. 1, 3, 5 C. 2, 3, 4 D. 3, 4, 5

B. A value 1 will be assigned to d.

Which of the following statements is correct about the C#.NET code snippet given below? int d = Convert.ToInt32( !(30 < 20) ); A. A value 0 will be assigned to d. B. A value 1 will be assigned to d. C. A value -1 will be assigned to d D. A value True will be assigned to d

D. An overflow error will be reported since the result of the multiplication exceeds the range of a Short Integer.

Which of the following statements is correct about the C#.NET code snippet given below? short s1 = 20, s2 = 400; int a = s1 * s2; A. A value 8000 will be assigned to a. B. During arithmetic if the result exceeds the Min or Max value of the range the value wraps around till the other side of the range. C. An error is reported as widening conversion cannot takes place. D. An overflow error will be reported since the result of the multiplication exceeds the range of a Short Integer.

D. The if statement selects a statement for execution based on the value of a Boolean expression

Which of the following statements is correct? A. It is impossible to extend the if statement to handle multiple conditions using the else-if arrangement. B. The switch statement can include any number of case instances with two case statements having the same value. C. A jump statement such as a break is required after each case block excluding the last block if it is a default statement. D. The if statement selects a statement for execution based on the value of a Boolean expression

A. Widening conversions take place automatically.

Which of the following statements is correct? A. Widening conversions take place automatically. B. Information is never lost during narrowing conversions. C. 3.14 can be treated as Decimal by using it in the form 3.14F. D. The CInteger() can be used to convert a single-precision floating point to an int.

D. All of the choices are correct.

Which of the following statements will clear the contents of a text box named MessageTextBox? A. MessageTextBox.Text = "" B. MessageTextBox.Clear() C. MessageTextBox.Text = String.Empty D. All of the choices are correct.

D. 25 125

Which of the following will be the correct output for the C#.NET program given below? class SampleProgram { public static void Main(string[] args) { int a = 5; int s = 0, c = 0; ProcedureCall(a, ref s, ref c); Console.WriteLine(s + " " + c); } public static void ProcedureCall(int x, ref int ss, ref int cc) { ss = x * x; cc = x * x * x; } } A. 0 0 B. 25 25 C. 125 125 D. 25 125

D. 1,2,3,4

Which statements are incorrect? 1. void x = 20; 2. int z=2147483648; 3. char c ="L"; 4. byte b= 256; 5. int y = 2012201212; A. 1,3 B. 2,3 C. 3,4,5 D. 1,2,3,4

C. radio buttons

You should use _______ to allow the user to choose the gender of the customer. A. check boxes B. text boxes C. radio buttons D. name boxes

B. Items

______ property is a collection, holds the list of items for a list box or combo box. A. List B. Items C. Collection D. ArrayList

A. The compiler will report case i and case j as errors since variables cannot be used in cases.

hich of the following statements is correct about the C#.NET code snippet given below? int i, j, id = 0; switch (id) { case i: Console.WriteLine("I am in Case i"); break; case j: Console.WriteLine("I am in Case j"); break; } A. The compiler will report case i and case j as errors since variables cannot be used in cases. B. Compiler will report an error since there is no default case in the switch case statement. C. The code snippet prints the result as "I am in Case i"". D. The code snippet prints the result as "I am in Case j".


Kaugnay na mga set ng pag-aaral

Module 5, Unit 4 - Secure Application Development

View Set

Structural Kinesiology Chapter 8

View Set

Chapter 38: Caring for Clients With Cerebrovascular Disorders

View Set

Ch. 6: Do it: Multiple Choice Quiz

View Set