Q201
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.
238
Questions
11/12
Page
Pick an option on a question to see the right answer and solution.
Q201
Open questionSelect an option to see the answer and solution.
Q202
Open questionnamespace ConsoleApplication4
{
class A
{
public int i;
public void display()
{
Console.WriteLine(i);
}
}
class B: A
{
public int j;
public void display()
{
Console.WriteLine(j);
}
}
class Program
{
static void Main(string[] args)
{
B obj = new B();
obj.j = 1;
obj.i = 8;
obj.display();
Console.ReadLine();
}
}
}Select an option to see the answer and solution.
Q203
Open question enum per
{
a,
b,
c,
d,
}
per.a = 10;
Console.writeline(per.b);Select an option to see the answer and solution.
Q204
Open questionclass sample
{
public sample()
{
Console.WriteLine("THIS IS BASE CLASS constructor");
}
}
public class sample1 : sample
{
}
class Program
{
static void Main(string[] args)
{
sample1 obj = new sample1();
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q205
Open questionSelect an option to see the answer and solution.
Q206
Open questionclass maths
{
public int x;
public double y;
public int add(int a, int b)
{
x = a + b;
return x;
}
public int add(double c, double d)
{
y = c + d;
return (int)y;
}
public maths()
{
this.x = 0;
this.y = 0;
}
}
class Program
{
static void Main(string[] args)
{
maths obj = new maths();
int a = 4;
double b = 3.5;
obj.add(a, a);
obj.add(b, b);
Console.WriteLine(obj.x + " " + obj.y);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q207
Open questioninterface a1
{
void f1();
int f2();
}
class a :a1
{
void f1()
{
}
int a1.f2()
{
}
}Select an option to see the answer and solution.
Q208
Open questionSelect an option to see the answer and solution.
Q209
Open questionSelect an option to see the answer and solution.
Q210
Open questionclass maths
{
public int fact(int n)
{
int result;
if (n == 2)
return 1;
result = fact(n - 1) * n;
return result;
}
}
class Program
{
static void Main(string[] args)
{
maths obj = new maths();
Console.WriteLine(obj.fact(4));
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q211
Open questionSelect an option to see the answer and solution.
Q212
Open questionclass a
{
public void fun()
{
Console.WriteLine("base method");
}
}
class b: a
{
public new void fun()
{
Console.WriteLine(" derived method ");
}
}
class Program
{
static void Main(string[] args)
{
b k = new b();
k.fun();
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q213
Open questionclass sample
{
public int i;
void display()
{
Console.WriteLine(i);
}
}
class sample1 : sample
{
public int j;
public void display()
{
Console.WriteLine(j);
}
}
class Program
{
static void Main(string[] args)
{
sample1 obj = new sample1();
obj.i = 1;
obj.j = 2;
obj.display();
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q214
Open question class abc
{
public static void a()
{
console.writeline("first method");
}
public void b()
{
a();
console.writeline("second method");
}
public void b(int i)
{
console.writeline(i);
b();
}
}
class program
{
static void main()
{
abc k = new abc();
abc.a();
k.b(20);
}
}Select an option to see the answer and solution.
Q215
Open questionclass Program
{
static void Main(string[] args)
{
Console.WriteLine( vol(10));
Console.WriteLine( vol(2.5f, 5));
Console.WriteLine( vol( 5l, 4, 5));
Console.ReadLine();
}
static int vol(int x)
{
return(x * x * x);
}
static float vol(float r, int h)
{
return(3.14f * r * r * h);
}
static long vol(long l, int b, int h)
{
return(l * b * h);
}
}Select an option to see the answer and solution.
Q216
Open questionclass maths
{
public int fun(int k, int y, int n)
{
Console.WriteLine(k + " " + y + " " + n);
return (k);
}
public int fun1(int t,float z)
{
Console.WriteLine(t + " " + z);
return t;
}
}
class Program
{
static void Main(string[] args)
{
maths obj = new maths();
int b = 90;
int c = 100;
int d ;
float l;
int i = obj.fun(b, c, 12);
int j = (obj.fun1(12, 14.78f));
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q217
Open questionclass sample
{
public int i;
public int[] arr = new int[10];
public void fun(int i, int val)
{
arr[i] = val;
}
}
class Program
{
static void Main(string[] args)
{
sample s = new sample();
s.i = 10;
sample.fun(1, 5);
s.fun(1, 5);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q218
Open questionstruct abc
{
public string name;
protected internal int age;
private Single sal;
}Select an option to see the answer and solution.
Q219
Open questionSelect an option to see the answer and solution.
Q220
Open questionstatic void Main(string[] args)
{
int X = 0;
if (Convert.ToBoolean(X = 0))
Console.WriteLine("It is zero");
else
Console.WriteLine("It is not zero");
Console.ReadLine();
}Select an option to see the answer and solution.