Question
static void Main(string[] args)
{
int[] nums = { 5, 4, 6, 3, 14, 9, 8, 17, 1, 24, -1, 0 };
Array.Sort(nums);
int idx = Array.BinarySearch(nums, 14);
if (idx == 9)
{
Console.WriteLine(Convert.ToBoolean(1));
}
else
{
Console.WriteLine(Convert.ToBoolean(0));
}
Console.WriteLine("Index of 14 is " + idx);
Console.ReadLine();
}
a.
True
0
b.
Run time error
c.
True
9
d.
None of the mentioned
Posted under C# programming
9
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What will be the output of given code snippet?
Similar Questions
Discover Related MCQs
Q. Which method will be used to copy content from one array to another array?
View solution
Q. Which mechanism among the following helps in identifying a type during the execution of a program?
View solution
Q. Select the statement which are correct about RTTI(Runtime type identification):
View solution
Q. Select the Keyword which supports the run time type identification:
View solution
Q. What does the following code signify?
expr is type
View solution
Q. Which operator among the following supports the operation of conversion at runtime without generating the exceptions?
View solution
Q. Which operator among the following is used to perform the operation of boxing, unboxing, reference and identity conversions?
View solution
Q. Which operator among the following supplies the information about characteristics of a typeof?
View solution
Q. Which feature enables to obtain information about the use and capabilities of types at runtime?
View solution
Q. Choose the namespace which consists of classes that are part of .NET Reflection API:
View solution
Q. Choose the correct statement about System.Type namespace:
View solution
Q. Choose the class from which the namespace ‘System.Type’ is derived:
View solution
Q. What does the following property signify?
MemberTypes MemberType
View solution
Q. The property signifies “Obtains a Module object that represents the module (an executable file) in which the reflected type resides”. Choose the property which specifies the following statement:
View solution
Q. Choose the method defined by MemberInfo:
View solution
Q. What does the following declaration specify?
MethodInfo[] GetMethods()
View solution
Q. What does the following code specify?
object Invoke(object obj, object[] parameters)
View solution
Q. What does the following method specify?
Type[] GetGenericArguments()
View solution
Q. Select the type of multitasking methods that exist:
View solution
Q. Choose the correct statement about process-based multitasking:
View solution
Suggested Topics
Are you eager to expand your knowledge beyond C# programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!