71. What will be the output of the following C# code snippet?
class Program
{
static void Main(string[] args)
{
double x = 4.772;
double y = 4.76;
double z = Math.Max(x, y);
Console.WriteLine(z);
Console.ReadLine();
}
}
class Program
{
static void Main(string[] args)
{
double x = 4.772;
double y = 4.76;
double z = Math.Max(x, y);
Console.WriteLine(z);
Console.ReadLine();
}
}
72. What will be the output of the following C# code snippet?
class sum
{
public int x;
public int y;
public int add (int a, int b)
{
x = a + b;
y = x + b;
return 0;
}
}
class Program
{
static void Main(string[] args)
{
sum obj1 = new sum();
sum obj2 = new sum();
int a = 2;
obj1.add(a, a + 1);
obj2.add(5, a);
Console.WriteLine(obj1.x + " " + obj2.y);
Console.ReadLine();
}
}
class sum
{
public int x;
public int y;
public int add (int a, int b)
{
x = a + b;
y = x + b;
return 0;
}
}
class Program
{
static void Main(string[] args)
{
sum obj1 = new sum();
sum obj2 = new sum();
int a = 2;
obj1.add(a, a + 1);
obj2.add(5, a);
Console.WriteLine(obj1.x + " " + obj2.y);
Console.ReadLine();
}
}
73. Which among the following is a correct statement about namespace used in C#.NET?
74. Consider an integer pointer . *a.++*a will increment . . . . . . . . while *a++ will increment . . . . . . . .
75. What will be the output of the following C# code snippet?
class UnsafeCode
{
unsafe static void Main()
{
int* p ;
int ch = 13*5;
p = &(ch);
Console.WriteLine(Convert.ToChar(*p));
if (*p == 'A')
Console.WriteLine(Convert.ToBoolean(1));
else
Console.WriteLine(Convert.ToBoolean(0));
Console.ReadLine();
}
}
class UnsafeCode
{
unsafe static void Main()
{
int* p ;
int ch = 13*5;
p = &(ch);
Console.WriteLine(Convert.ToChar(*p));
if (*p == 'A')
Console.WriteLine(Convert.ToBoolean(1));
else
Console.WriteLine(Convert.ToBoolean(0));
Console.ReadLine();
}
}
76. What does the following C# code specify?
object Invoke(object obj, object[] parameters)
object Invoke(object obj, object[] parameters)
77. What does the following C# code set specifies?
public static int Compare(string strA, string strB)
public static int Compare(string strA, string strB)
78. Which of the following is not a namespace in the .NET Framework Class Library?
79. What will be the output of the following C# code snippet?
class Program
{
static void Main(string[] args)
{
float x = 3.14F;
int y = (int)Math.Abs(x);
Console.WriteLine(y);
Console.ReadLine();
}
}
class Program
{
static void Main(string[] args)
{
float x = 3.14F;
int y = (int)Math.Abs(x);
Console.WriteLine(y);
Console.ReadLine();
}
}
80. Which among the following is not the ordered collection class?
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.