Q101
Open questionint a+= (float) b/= (long)c.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.
238
Questions
6/12
Page
Pick an option on a question to see the right answer and solution.
Q101
Open questionint a+= (float) b/= (long)c.Select an option to see the answer and solution.
Q102
Open questionSelect an option to see the answer and solution.
Q103
Open questionSelect an option to see the answer and solution.
Q104
Open questionSelect an option to see the answer and solution.
Q105
Open questionnamespace ConsoleApplication4
{
public abstract class A
{
public int i = 7;
public abstract void display();
}
class B: A
{
public int j;
public override void display()
{
Console.WriteLine(i);
Console.WriteLine(j);
}
}
class Program
{
static void Main(string[] args)
{
B obj = new B();
A obj1 = new B();
obj.j = 1;
obj1.i = 8;
obj.display();
Console.ReadLine();
}
}
}Select an option to see the answer and solution.
Q106
Open questioncsharp abc;
abc = new charp();Select an option to see the answer and solution.
Q107
Open questionSelect an option to see the answer and solution.
Q108
Open question class A
{
public virtual void display()
{
Console.WriteLine("A");
}
}
class B: A
{
public override void display()
{
Console.WriteLine(" B ");
}
}
class Program
{
static void Main(string[] args)
{
A obj1 = new A();
B obj2 = new B();
A r;
r = obj1;
r.display();
r = obj2;
r.display();
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q109
Open questionSelect an option to see the answer and solution.
Q110
Open questionSelect an option to see the answer and solution.
Q111
Open questionSelect an option to see the answer and solution.
Q112
Open questionSelect an option to see the answer and solution.
Q113
Open questionSelect an option to see the answer and solution.
Q114
Open questioninterface calc
{
void cal(int i);
}
public class maths :calc
{
public int x;
public void cal(int i)
{
x = i * i;
}
}
class Program
{
public static void Main(string[] args)
{
display arr = new display();
arr.x = 0;
arr.cal(2);
Console.WriteLine(arr.x);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q115
Open questionenum color:int
{
red,
green,
blue = 5,
cyan,
pink = 10,
brown
}
console.writeline((int)color.green);
console.writeline((int)color.brown);Select an option to see the answer and solution.
Q116
Open questionclass maths
{
int i;
public maths(int ii)
{
ii = -25;
int g;
g = ii > 0 ? ii : ii * -1;
Console.WriteLine(g);
}
}
class maths1 :maths
{
public maths1(int ll) :base(ll)
{
ll = -1000;
Console.WriteLine((ll > 0 ? ll : ll * -1));
}
}
class Program
{
static void Main(string[] args)
{
maths1 p = new maths1(6);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q117
Open questionSelect an option to see the answer and solution.
Q118
Open questionSelect an option to see the answer and solution.
Q119
Open questionclass maths
{
public static void fun1()
{
Console.WriteLine("method 1 :");
}
public void fun2()
{
fun1();
Console.WriteLine("method 2 :");
}
public void fun2(int k)
{
Console.WriteLine(k);
fun2();
}
}
class Program
{
static void Main(string[] args)
{
maths obj = new maths();
maths.fun1();
obj.fun2(20);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q120
Open questionstatic void Main(string[] args)
{
int a = 10 , b = 20;
Console.WriteLine("Result before swap is: "+ a +" "+b);
swap(ref a, ref b);
Console.ReadLine();
}
static void swap(ref int i, ref int j)
{
int t;
t = i;
i = j;
j = t;
Console.WriteLine("Result after swap is:"+ i +" "+j);
}Select an option to see the answer and solution.