Q141
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
170
Questions
8/9
Page
Pick an option on a question to see the right answer and solution.
Q141
Open questionSelect an option to see the answer and solution.
Q142
Open questionpublic System.Collections.IEnumerator GetEnumerator()
{
foreach (char ch in chrs)
yield return ch;
}Select an option to see the answer and solution.
Q143
Open questionclass Book
{
public void issue()
{
/* code */
}
}
class Journel
{
public void issue()
{
/* code */
}
}Select an option to see the answer and solution.
Q144
Open questionclass UnsafeCode
{
static void Main()
{
int? count = null;
int? result = null;
int incr = 10;
result = count + incr;
if (result.HasValue)
Console.WriteLine("result has this value: " + result.Value);
else
Console.WriteLine("result has no value");
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q145
Open questionSelect an option to see the answer and solution.
Q146
Open question#define DEBUG
#undef DEBUG
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication13
{
class Program
{
static void Main(string[] args)
{
#if (DEBUG)
Console.WriteLine("DEBUG is defined");
#elif (!DEBUG && MYTEST)
Console.WriteLine("MYTEST is defined");
#elif (DEBUG && MYTEST)
Console.WriteLine("DEBUG and MYTEST are defined");
#else
Console.WriteLine("DEBUG and MYTEST are not defined");
#endif
Console.ReadLine();
}
}
}Select an option to see the answer and solution.
Q147
Open questionclass UnsafeCode
{
struct MyStruct
{
public int a;
public int b;
public int Sum()
{
return a * b;
}
}
unsafe static void Main()
{
MyStruct o = new MyStruct();
MyStruct* p;
p = &o;
p->a = 10;
p->b = 20;
Console.WriteLine("Value is " + p->Sum());
Console.ReadLine();
}Select an option to see the answer and solution.
Q148
Open questionclass UnsafeCode
{
unsafe static void Main()
{
int* a;
int a1 = 10;
int b1;
b1 = *&a1;
a = &b1;
{
Console.WriteLine(*a);
Console.ReadLine();
}
}
}Select an option to see the answer and solution.
Q149
Open questionSelect an option to see the answer and solution.
Q150
Open questionSelect an option to see the answer and solution.
Q151
Open questionSelect an option to see the answer and solution.
Q152
Open questionclass test
{
public int a;
public int b;
public test(int i, int j)
{
a = i;
b = j;
}
public void meth(test o)
{
o.a *= 2;
o.b /= 2;
}
}
class Program
{
static void Main(string[] args)
{
test obj = new test(10, 20);
obj.meth(obj);
Console.WriteLine(obj.a + " " + obj.b);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q153
Open questionSelect an option to see the answer and solution.
Q154
Open questionSelect an option to see the answer and solution.
Q155
Open questionSelect an option to see the answer and solution.
Q156
Open questionSelect an option to see the answer and solution.
Q157
Open questionSelect an option to see the answer and solution.
Q158
Open questionSelect an option to see the answer and solution.
Q159
Open questionSelect an option to see the answer and solution.
Q160
Open questionSelect an option to see the answer and solution.