Options are not available for this question.
Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
134
Questions
5/7
Page
Pick an option on a question to see the right answer and solution.
Options are not available for this question.
Select an option to see the answer and solution.
static void Main(string[] args)
{
StringBuilder s = new StringBuilder("object");
s./*______*/("Oriented Language");
Console.WriteLine(s);
Console.ReadLine();
}
Output : objectOriented LanguageSelect an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
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]));
}
}Select an option to see the answer and solution.
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();
}Select an option to see the answer and solution.
static void Main(string[] args)
{
double a = 345.09;
byte c = (byte) a;
Console.WriteLine(c);
Console.ReadLine();
}Select an option to see the answer and solution.
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();
}
}Select an option to see the answer and solution.
static void Main(string[] args)
{
String obj = "hello";
String obj1 = "worn";
String obj2 = obj;
Console.WriteLine(obj + " " + (obj1.Replace('w' ,'c')));
Console.ReadLine();
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
class Program
{
static void Main(string[] args)
{
String []chars = {"z", "x", "y", "z", "y"};
for (int i = 0; i < chars.Length; ++i)
for (int j = i + 1; j < chars.Length; ++j)
if(chars[i].CompareTo(chars[j]) == 0)
Console.WriteLine(chars[j]);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
static void Main(string[] args)
{
string s1 = "Hello" + " I " + "Love" + " ComputerScience ";
Console.WriteLine(s1);
Console.ReadLine();
}Select an option to see the answer and solution.
String a = "Csharp";
String b = "CSHARP";
int c;
c = a.CompareTo(b);
Console.WriteLine(c);Select an option to see the answer and solution.
int[][]a = new int[2][];
a[0] = new int[3]{3, 4, 2};
a[1] = new int[2]{8, 5};
foreach( int[]i in a)
{
/* add for loop */
console.write( j+ " ");
console.writeline();
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
static void Main(string[] args)
{
Program p = new Program();
p.display(2, 3, 8);
int []a = { 2, 56, 78, 66 };
Console.WriteLine("example of array");
Console.WriteLine("elements added are");
p.display(a);
Console.ReadLine();
}
public void display(params int[] b)
{
foreach (int i in b)
{
Console.WriteLine("ARRAY IS HAVING:{0}", i);
}
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
Q100
Open questionstatic void main(string[] args)
{
int []arr = new int[]{ 1, 2, 3, 4, 5};
fun (ref arr);
for (int i = 0; i < arr.Length ; i++)
Console.WriteLine( arr[i] + " ");
}
static void fun(ref int[]a)
{
a = new int[6];
a[3] = 32;
a[1] = 24;
}Select an option to see the answer and solution.