Thursday, 21 July 2016

MT C# ques- 15 to 26

*      The ____ block in the if…else construct is optional and can be omitted.
*      Answer:
*       else
*      The _______ statement is used to exit the switch statement.
*      Answer:
*       break
-------------------------------------
*      State whether the following statement is True or False:
*       In the while loop, the while statement always checks the   condition after executing the statements within the loop.
*      Answer:
*       False
-------------------------------------------
*      The statements within the _________ loop are executed at least once.
*      Answer:
*       do..While
---------------------------------------
*      State whether the following statement is True or False:          
*       In a for loop, the initialization expression is executed only  once at the beginning of the loop.
*      Answer:
*       True
--------------------------
*      Which of the following statements is the correct syntax of declaring a character array?
a.            char [] ch;
b.            char ch [];
c.             char { } ch;
d.            char ch { };
*      Answer:
a.            char [] ch;
-----------------------------------
*      Which of the following options can you use to assign values to an array? (Choose all that apply)
a.            int[] arr = new int[2];
arr[0] = 5;
arr[1] = 3;
b.            int[] arr = new int[2] {0, 1};
c.             int [] arr = new int [2][0,1];
d.            int[] arr = {5, 10};
*      Answer:
a.            int[] arr = new int[2];
arr[0] = 5;
arr[1] = 3;
b.            int[] arr = new int[2] {0, 1};
d.            int[] arr = {5, 10};
------------------------------------------------------------------
*      The ________ statement interprets the common loop process and removes the need to check the array size.
*      Answer: *       foreach

----------------------------------------------------------
*      Which of the following methods of the Array class will return the number of items in an array?
a. GetLength()
b. GetValue()
c. IndexOf()
d. Sort()
*      Answer:  a. GetLength()
----------------------------------------
*      Which of the following options are the possible states of a mobile phone? (Choose all that apply)
a.       Off
b.      Ring
c.       Vibrate
d.      Color
*      Answer:
a.       Off
b.      Ring
c.       Vibrate
----------------------------------
*      John went to a shopping mall to buy some clothes. The door of the shopping mall was automatic, which opened as soon as John stepped near it and closed as soon as John entered the mall. Identify the possible receiver of the message in this situation.
a.       Door
b.      John
c.       Shopping mall
d.      Clothes
*      Answer:
a.       Door

1 comment: