1. 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?
2. Choose the symbol which begins a preprocessor directive in C#.NET?
3. What will be the declaration of the variable ptr as the pointer to array of 6 floats?
4. What is an iterator?
5. Which of these methods return a largest whole number less than or equal to variable X?
6. What does the following C# method specify?
Type[] GetGenericArguments()
Type[] GetGenericArguments()
7. What will be the output of the following C# code segment?
class UnsafeCode
{
unsafe static void Main()
{
int n = 10;
void* p = &n;
Console.WriteLine(*p);
Console.ReadLine();
}
}
class UnsafeCode
{
unsafe static void Main()
{
int n = 10;
void* p = &n;
Console.WriteLine(*p);
Console.ReadLine();
}
}
8. What will be the output of the following C# code snippet?
class UnsafeCode
{
unsafe static void Main()
{
int* p;
p = (int*)(65535);
Console.WriteLine((uint)p);
Console.ReadLine();
}
}
class UnsafeCode
{
unsafe static void Main()
{
int* p;
p = (int*)(65535);
Console.WriteLine((uint)p);
Console.ReadLine();
}
}
9. What will be the output of the following C# code snippet?
class Program
{
static void Main(string[] args)
{
double x = 3.14;
int y = (int) Math.Floor(x);
Console.WriteLine(y);
}
}
class Program
{
static void Main(string[] args)
{
double x = 3.14;
int y = (int) Math.Floor(x);
Console.WriteLine(y);
}
}
10. What will be the output of the following C# code snippet?
class UnsafeCode
{
unsafe static void Main()
{
int[] nums = new int[10];
Console.WriteLine("Index pointer like array.");
fixed (int* p = nums)
{
for (int i = 0 ;i <10 ;i++)
p[i] = i;
for (int i = 10 ;i >0 ;i--)
Console.WriteLine("p[{0}]: {1} ", i, p[i]);
Console.ReadLine();
}
}
}
class UnsafeCode
{
unsafe static void Main()
{
int[] nums = new int[10];
Console.WriteLine("Index pointer like array.");
fixed (int* p = nums)
{
for (int i = 0 ;i <10 ;i++)
p[i] = i;
for (int i = 10 ;i >0 ;i--)
Console.WriteLine("p[{0}]: {1} ", i, p[i]);
Console.ReadLine();
}
}
}
Read More Section(Miscellaneous in C Sharp)
Each Section contains maximum 100 MCQs question on Miscellaneous in C Sharp. To get more questions visit other sections.