Q141
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
8/12
Page
Pick an option on a question to see the right answer and solution.
Q141
Open questionSelect an option to see the answer and solution.
Q142
Open questionSelect an option to see the answer and solution.
Q143
Open questionSelect an option to see the answer and solution.
Q144
Open questionclass recursion
{
int fact(int n)
{
int result;
if (n == 1)
return 1;
result = fact(n - 1) * n;
return result;
}
}
class Program
{
public static void main(String args[])
{
recursion obj = new recursion() ;
Console.WriteLine(obj.fact(4));
}
}Select an option to see the answer and solution.
Q145
Open questionSelect an option to see the answer and solution.
Q146
Open questionSelect an option to see the answer and solution.
Q147
Open questionSelect an option to see the answer and solution.
Q148
Open questionstatic void Main(string[] args)
{
int[] arr = new int[] {1, 2, 3, 4, 5};
fun1(ref arr);
Console.ReadLine();
}
static void fun1(ref int[] array)
{
for (int i = 0; i < array.Length; i++)
{
array[i] = array[i] + 5;
Console.WriteLine(array[i] + " ");
}
}Select an option to see the answer and solution.
Q149
Open questionSelect an option to see the answer and solution.
Q150
Open questionstatic void Main(string[] args)
{
int a = 5;
fun1 (ref a);
Console.WriteLine(a);
Console.ReadLine();
}
static void fun1(ref int a)
{
a = a * a;
}Select an option to see the answer and solution.
Q151
Open questionclass abc
{
int i;
float k;
public abc(int ii, float kk)
{
i = ii;
k = kk;
}
}Select an option to see the answer and solution.
Q152
Open questionclass maths
{
public int fun(int k, int y)
{
return k + y;
}
public int fun1(int t, float z)
{
return (t+(int)z);
}
}
class Program
{
static void Main(string[] args)
{
maths obj = new maths();
int i;
int b = 90;
int c = 100;
int d = 12;
float l = 14.78f;
i = obj.fun(b, c);
Console.WriteLine(i);
int j = (obj.fun1(d, l));
Console.WriteLine(j);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q153
Open questionSelect an option to see the answer and solution.
Q154
Open questionSelect an option to see the answer and solution.
Q155
Open questionstatic void Main(string[] args)
{
int i = 5;
int j = 6;
add(ref i);
add(6);
Console.WriteLine(i);
Console.ReadLine();
}
static void add(ref int x)
{
x = x * x;
}
static void add(int x)
{
Console.WriteLine(x * x * x);
}Select an option to see the answer and solution.
Q156
Open questionclass sample
{
public int i;
public int j;
public void fun(int i, int j)
{
this.i = i;
this.j = j;
}
}
class Program
{
static void Main(string[] args)
{
sample s = new sample();
s.i = 1;
s.j = 2;
s.fun(s.i, s.j);
Console.WriteLine(s.i + " " + s.j);
Console.ReadLine();
}
}Select an option to see the answer and solution.
Q157
Open questionclass baseclass
{
private int a;
protected int b;
public int c;
}
class derived : baseclass
{
private int x;
protected int y;
public int z;
}
class Program
{
static Void Main(string[] args)
{
derived a = new derived();
}
}Select an option to see the answer and solution.
Q158
Open questionSelect an option to see the answer and solution.
Q159
Open questionOptions are not available for this question.
Select an option to see the answer and solution.
Q160
Open questionSelect an option to see the answer and solution.