static void Main(string[] args)
{
int i = 10;
double d = 35.78;
fun(i);
fun(d);
Console.ReadLine();
}
static void fun(double d)
{
Console.WriteLine(d);
}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
4/12
Page
Pick an option on a question to see the right answer and solution.
static void Main(string[] args)
{
int i = 10;
double d = 35.78;
fun(i);
fun(d);
Console.ReadLine();
}
static void fun(double d)
{
Console.WriteLine(d);
}Select an option to see the answer and solution.
class baseclass
{
int a;
public baseclass(int a1)
{
a = a1;
console.writeline(" a ");
}
class derivedclass : baseclass
{
public derivedclass (int a1) : base(a1)
{
console.writeline(" b ");
}
}
class program
{
static void main(string[] args)
{
derivedclass d = new derivedclass(20);
}
}
}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.
Select an option to see the answer and solution.
class A
{
public int i;
protected int j;
}
class B : A
{
public int j;
public void display()
{
base.j = 3;
Console.WriteLine(i + " " + j);
}
}
class Program
{
static void Main(string[] args)
{
B obj = new B();
obj.i = 1;
obj.j = 2;
obj.display();
Console.ReadLine();
}
}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.
Select an option to see the answer and solution.
class overload
{
public int x;
int y;
public int add(int a)
{
x = a + 1;
return x;
}
public int add(int a, int b)
{
x = a + 2;
return x;
}
}
class Program
{
static void Main(string[] args)
{
overload obj = new overload();
overload obj1 = new overload();
int a = 0;
obj.add(6);
obj1.add(6, 2);
Console.WriteLine(obj.x);
Console.WriteLine(obj1.x);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
class maths
{
int i;
public maths(int x)
{
i = x;
Console.WriteLine(" hello: ");
}
}
class maths1 : maths
{
public maths1(int x) :base(x)
{
Console.WriteLine("bye");
}
}
class Program
{
static void Main(string[] args)
{
maths1 k = new maths1(12);
Console.ReadLine();
}
}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.
class abc
{
int i;
Decimal d;
}
struct sample
{
private int x;
private Single y;
private trial z;
}
sample s = new sample();Select an option to see the answer and solution.
Select an option to see the answer and solution.
class maths
{
int i;
public maths(int ii)
{
ii = 12;
int j = 12;
int r = ii * j;
Console.WriteLine(r);
}
}
class maths1 : maths
{
public maths1(int u) :base(u)
{
u = 13;
int h = 13;
Console.WriteLine(u + h);
}
}
class maths2 : maths1
{
public maths2(int k) :base(k)
{
k = 24;
int o = 6 ;
Console.WriteLine(k /o);
}
}
class Program
{
static void Main(string[] args)
{
maths2 t = new maths2(10);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
class test
{
public void print()
{
Console.WriteLine("Csharp:");
}
}
class Program
{
static void Main(string[] args)
{
test t;
t.print();
Console.ReadLine();
}
}Select an option to see the answer and solution.
Select an option to see the answer and solution.