81. Select the correct declaration of the defining array of parameters.
82. Choose the effective stringBuilder method which helps in producing output for the following C# code?
static void Main(string[] args)
{
StringBuilder s = new StringBuilder("object");
s./*______*/("Oriented Language");
Console.WriteLine(s);
Console.ReadLine();
}
Output : objectOriented Language
static void Main(string[] args)
{
StringBuilder s = new StringBuilder("object");
s./*______*/("Oriented Language");
Console.WriteLine(s);
Console.ReadLine();
}
Output : objectOriented Language
83. Which of these methods is used to compare two strings such that after comparison output returns different integer values as (0 for false, 1 for true)?
84. Which of the following statements is correct?
85. What will be the output of the following C# code?
static void Main(string[] args)
{
int[] x = {65, 66, 67, 68, 69, 70};
fun(x);
Console.ReadLine();
}
static void fun(params int[] b )
{
int i;
for (i = 5; i > 0 ; i--)
{
b[i] = b[i] + 32;
Console.WriteLine(Convert.ToChar(b[i]));
}
}
static void Main(string[] args)
{
int[] x = {65, 66, 67, 68, 69, 70};
fun(x);
Console.ReadLine();
}
static void fun(params int[] b )
{
int i;
for (i = 5; i > 0 ; i--)
{
b[i] = b[i] + 32;
Console.WriteLine(Convert.ToChar(b[i]));
}
}
86. What will be the output of the following C# code?
static void Main(string[] args)
{
String a = "Ilove";
String b = "CSHARP";
b = string.Concat(a,' ',b);
string d = b.TrimStart('I', 'l', 'o', 'H');
Console.WriteLine(d);
Console.ReadLine();
}
static void Main(string[] args)
{
String a = "Ilove";
String b = "CSHARP";
b = string.Concat(a,' ',b);
string d = b.TrimStart('I', 'l', 'o', 'H');
Console.WriteLine(d);
Console.ReadLine();
}
87. What will be the output of the following C# code?
static void Main(string[] args)
{
double a = 345.09;
byte c = (byte) a;
Console.WriteLine(c);
Console.ReadLine();
}
static void Main(string[] args)
{
double a = 345.09;
byte c = (byte) a;
Console.WriteLine(c);
Console.ReadLine();
}
88. What will be the output of the following C# code?
class sum
{
public int x;
private int y;
public void math(int a, int b)
{
x = a * 4;
y = b;
}
}
class Program
{
static void Main(string[] args)
{
sum p = new sum();
p.math(12, 30);
Console.WriteLine(p.x + " " + p.y);
Console.ReadLine();
}
}
class sum
{
public int x;
private int y;
public void math(int a, int b)
{
x = a * 4;
y = b;
}
}
class Program
{
static void Main(string[] args)
{
sum p = new sum();
p.math(12, 30);
Console.WriteLine(p.x + " " + p.y);
Console.ReadLine();
}
}
89. What will be the output of the following C# code?
static void Main(string[] args)
{
String obj = "hello";
String obj1 = "worn";
String obj2 = obj;
Console.WriteLine(obj + " " + (obj1.Replace('w' ,'c')));
Console.ReadLine();
}
static void Main(string[] args)
{
String obj = "hello";
String obj1 = "worn";
String obj2 = obj;
Console.WriteLine(obj + " " + (obj1.Replace('w' ,'c')));
Console.ReadLine();
}
90. Choose selective differences between an array in c# and array in other programming languages.
Read More Section(Arrays and Strings in C Sharp)
Each Section contains maximum 100 MCQs question on Arrays and Strings in C Sharp. To get more questions visit other sections.