Q121
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
7/12
Page
Pick an option on a question to see the right answer and solution.
Q121
Open questionSelect an option to see the answer and solution.
Q122
Open questionSelect an option to see the answer and solution.
Q123
Open questionstatic void Main(string[] args)
{
int []a = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
func(ref a);
Console.ReadLine();
}
static void func(ref int[] x)
{
Console.WriteLine(" numbers are:");
for (int i = 0; i < x.Length; i++)
{
if (x[i] % 2 == 0)
{
x[i] = x[i] + 1;
Console.WriteLine(x[i]);
}
}
}Select an option to see the answer and solution.
Q124
Open questionenum letters
{
a,
b,
c
}
letters l;
l = letters.a;
Console.writeline(l);Select an option to see the answer and solution.
Q125
Open questionstatic void Main(string[] args)
{
int y = 3;
y++;
if (y <= 5)
{
Console.WriteLine("hi");
Main(args);
}
Console.ReadLine();
}Select an option to see the answer and solution.
Q126
Open questionclass maths
{
public int fun(int ii)
{
return(ii > 0 ? ii :ii * -1);
}
public long fun(long ll)
{
return(ll > 0 ? ll :ll * -1);
}
public double fun( double dd)
{
return(dd > 0 ? dd :dd * -1);
}
}
class Program
{
static void Main(string[] args)
{
maths obj = new maths();
int i = -25;
int j ;
long l = -100000l ;
long m;
double d = -12.34;
double e;
j = obj.fun(i);
m = obj.fun(l);
e = obj.fun(d);
Console.WriteLine(j + " " + m + " " + e);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q127
Open questionSelect an option to see the answer and solution.
Q128
Open questionSelect an option to see the answer and solution.
Q129
Open questionSelect an option to see the answer and solution.
Q130
Open questionclass maths
{
public int fun1(int k)
{
k = 20;
return k;
}
public Single fun1(float t)
{
t = 3.4f;
return t;
}
}
class Program
{
static void Main(string[] args)
{
maths obj = new maths();
int i;
i = obj.fun1(30);
Console.WriteLine(i);
Single j;
j = obj.fun1(2.5f);
Console.WriteLine(j);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q131
Open questionSelect an option to see the answer and solution.
Q132
Open questionSelect an option to see the answer and solution.
Q133
Open questionSelect an option to see the answer and solution.
Q134
Open questionSelect an option to see the answer and solution.
Q135
Open questionSelect an option to see the answer and solution.
Q136
Open questionclass sample
{
int i;
double k;
public sample (int ii, double kk)
{
i = ii;
k = kk;
double j = (i) + (k);
Console.WriteLine(j);
}
~sample()
{
double j = i - k;
Console.WriteLine(j);
}
}
class Program
{
static void Main(string[] args)
{
sample s = new sample(8, 2.5);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q137
Open questionSelect an option to see the answer and solution.
Q138
Open questionSelect an option to see the answer and solution.
Q139
Open questionSelect an option to see the answer and solution.
Q140
Open questionclass maths
{
int fact(int n)
{
int result;
if (n == 1)
return 1;
result = fact(n - 1) * n;
return result;
}
}
class Output
{
static void main(String args[])
{
maths obj = new maths() ;
Console.WriteLine(obj.fact(4)*(3));
}
}Select an option to see the answer and solution.