Online Test | Technical MCQ Test

9

Instruction:

Total number of questions : 20

Time allotted : 20 minutes.

Each question carry 1 mark, no negative marks.

C # Quiz - Part -01

 

Instruction:

Total number of questions : 20

Time allotted : 20 minutes.

Each question carry 1 mark, no negative marks.

C # Quiz - Part -01

 


C Sharp

C # Quiz -1

C Sharp Quizzes for Freshers

1 / 20

Category: Data Types, Variables and Operators

Choose “.NET class” name from which data type “UInt” is derived?

2 / 20

Category: Data Types, Variables and Operators

Which Conversion function of ‘Convert.TOInt32()’ and ‘Int32.Parse()’ is efficient?

i) Int32.Parse() is only used for strings and throws argument exception for null string

ii) Convert.Int32() used for data types and returns directly '0' for null string

3 / 20

Category: Data Types, Variables and Operators

Correct Declaration of Values to variables ‘a’ and ‘b’?

4 / 20

Category: Data Types, Variables and Operators

 How many Bytes are stored by ‘Long’ Data type in C# .net?

5 / 20

Category: Initialization of Variables in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
int a = 5;
int b = 10;
int c;
Console.WriteLine(c = ++ a + b ++);
Console.WriteLine(b);
Console.ReadLine();
}

6 / 20

Category: Initialization of Variables in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
const int a = 5;
const int b = 6;
for (int i = 1; i <= 5; i++)
{
a = a * i;
b = b * i;
}
Console.WriteLine(a);
Console.WriteLine(b);
Console.ReadLine();
}

7 / 20

Category: Initialization of Variables in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
int a = 5;
int b = 10;
int c;
Console.WriteLine(c = a-- - ++b);
Console.WriteLine(b);
Console.ReadLine();
}

8 / 20

Category: Initialization of Variables in C#

The following C# codes are?

i) Myclass class;

Myclass class2 = null;

ii) int i;

int j = 0;

9 / 20

Category: Floating and Decimal Data Types in C#

Minimum and Maximum range of values supported by ‘float’ data type are?

10 / 20

Category: Floating and Decimal Data Types in C#

Valid Size of float data type is?

11 / 20

Category: Floating and Decimal Data Types in C#

Correct way to define a value 6.28 in a variable ‘pi’ where value cannot be modified?

12 / 20

Category: Floating and Decimal Data Types in C#

Why does a float variable stop incrementing at number ‘16777216’ in the following C# code?

float a = 0 ;
while (true)
{
a++;
if (a > 16777216)
break;
}

13 / 20

Category: Floating and Decimal Data Types in C#

The Default value of Boolean Data Type is?

14 / 20

Category: Uncategorized

Default Type of number without decimal is?

15 / 20

Category: Char Types and String Literals in C#

Why strings are of reference type in C#.NET?

16 / 20

Category: Scope and Lifetime of Variables in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
int i ;
for (i = 0; i < 5; i++)
{
int j = 0;
j += i;
Console. WriteLine(j);
}
Console. WriteLine( i * j);
Console. ReadLine();
}

17 / 20

Category: Scope and Lifetime of Variables in C#

What will be the output of the following C# code?

class Program
{
public static void Main(string[] args)
{
int i, j;
i = (j = 5) + 10;
Console. WriteLine(i);
Console. WriteLine(j);
Console. ReadLine();
}
}

18 / 20

Category: Scope and Lifetime of Variables in C#

Select differences between reference type and value type:

i. Memory allocated to ‘Value type’ is from heap and reference type is from ‘System. ValueType’
ii. Memory allocated to ‘Value type’ is from ‘System. ValueType’ and reference type is from ‘Heap’
iii. Structures, enumerated types derived from ‘System. ValueType’ are created on stack, hence known as ValueType and all ‘classes’ are reference type because values are stored on heap

19 / 20

Category: Scope and Lifetime of Variables in C#

What will be the output of the following C# code?

public static void Main(string[] args)
{
int i = 123;
object o = i;
i = 456;
System. Console. WriteLine("The value-type value = {0}", i);
System. Console. WriteLine("The object-type value = {0}", o);
Console. ReadLine();
}

20 / 20

Category: Scope and Lifetime of Variables in C#

What will be the output of the following C# code?

class Program
{
static void Main(string[] args)
{
int i ;
for (i = 0; i < 5; i++)
{
Console.WriteLine(i);
}
Console.ReadLine();
}
}

Your score is

The average score is 31%

0%

0

Instruction:

Total number of questions : 20

Time allotted : 20 minutes.

Each question carry 1 mark, no negative marks.

C # Quiz Part -02

Instruction:

Total number of questions : 20

Time allotted : 20 minutes.

Each question carry 1 mark, no negative marks.

C # Quiz Part -02


C Sharp

C # Quiz -2

C Sharp Quizzes for Freshers

1 / 20

Category: Scope and Lifetime of Variables in C#

Choose the correct type of variable scope for the following C# defined variables.

class ABC
{
static int m;
int n;
void fun (int x , ref int y, out int z, int[] a)
{
int j = 10;
}
}

2 / 20

Category: Scope and Lifetime of Variables in C#

What will be the output of the following C# code?

public static void Main(string[] args)
{
int i = 546;
object o = i;
int n =(int) o;
o = 70;
System. Console. WriteLine("The value-type value = {0}", n);
System. Console. WriteLine("The object-type value = {0}", o);
Console. ReadLine();
}

3 / 20

Category: Floating and Decimal Data Types in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
int x = 1;
float y = 2. 4f;
short z = 1;
Console. WriteLine((float) x + y * z - (x + = (short) y) );
Console. ReadLine();
}

4 / 20

Category: Floating and Decimal Data Types in C#

Select a convenient declaration and initialization of a floating point number

5 / 20

Category: Floating and Decimal Data Types in C#

A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?

6 / 20

Category: Floating and Decimal Data Types in C#

The Default value of Boolean Data Type is?

7 / 20

Category: Data Types, Variables and Operators

What will be the output of the following C# code?

static void Main(string[] args)
{
float a = 10.553f;
long b = 12L;
int c;
c = Convert.ToInt32(a + b);
Console.WriteLine(c);
}

8 / 20

Category: Data Types, Variables and Operators

Which Conversion function of ‘Convert.TOInt32()’ and ‘Int32.Parse()’ is efficient?

i) Int32.Parse() is only used for strings and throws argument exception for null string

ii) Convert.Int32() used for data types and returns directly '0' for null string

9 / 20

Category: Char Types and String Literals in C#

What will be the output of the following C# string? (Enter a String : BOMBAY).

static void Main(string[] args)
{
string Str, Revstr = " ";
int Length;
Console.Write("Enter A String : ");
Str = Console.ReadLine();
Length = Str.Length - 1;
while (Length >= 0)
{
Revstr = Revstr + Str[Length];
Length --;
}
Console.WriteLine("Reverse String Is {0}", Revstr);
Console.ReadLine();
}

10 / 20

Category: Char Types and String Literals in C#

Correct statement about strings are?

11 / 20

Category: Char Types and String Literals in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
string s1 = "Delhi";
string s2;
s2 = s1.Insert (6, "Jaipur");
Console.WriteLine(s2);
}

12 / 20

Category: Char Types and String Literals in C#

Given is the code of days(example:”MTWTFSS”) which I need to split and hence create a list of days of week in strings( example:”Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”, “Sunday”). A set of code is given for this purpose but there is the error occurring in that set of code related to the conversion of char to strings. Hence, Select a C# code to solve the given error.

 

static void Main(string[] args)
{
var days = "MTWTFSS";
var daysArray = days.ToCharArray().Cast<string>().ToArray();
for (var i = 0; i < daysArray.Length; i++)
{
switch (daysArray[i])
{
case "M":
daysArray[i] = "Monday";
break;
case "T":
daysArray[i] = "Tuesday";
break;
case "W":
daysArray[i] = "Wednesday";
break;
case "R":
daysArray[i] = "Thursday";
break;
case "F":
daysArray[i] = "Friday";
break;
case "S":
daysArray[i] = "Saturday";
break;
case "U":
daysArray[i] = "Sunday";
break;
}
}
daysArray[daysArray.Length - 1] = "and " + daysArray[daysArray.Length - 1];
Console.WriteLine(string.Join(", ", daysArray));
}

13 / 20

Category: Char Types and String Literals in C#

What is the Size of ‘Char’ datatype?

14 / 20

Category: Char Types and String Literals in C#

For two strings s1 and s2 to be equal, which is the correct way to find if the contents of two strings are equal?

15 / 20

Category: Initialization of Variables in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
int a = 5;
int b = 10;
int c;
Console.WriteLine(c = a-- - ++b);
Console.WriteLine(b);
Console.ReadLine();
}

16 / 20

Category: Initialization of Variables in C#

DIFFERENCE BETWEEN KEYWORDS ‘VAR’ AND ‘DYNAMIC’?

17 / 20

Category: Initialization of Variables in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
int a = 5;
int b = 10;
int c;
Console.WriteLine(c = ++ a + b ++);
Console.WriteLine(b);
Console.ReadLine();
}

18 / 20

Category: Initialization of Variables in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
const int a = 5;
const int b = 6;
for (int i = 1; i <= 5; i++)
{
a = a * i;
b = b * i;
}
Console.WriteLine(a);
Console.WriteLine(b);
Console.ReadLine();
}

19 / 20

Category: Initialization of Variables in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
String name = "Dr.Gupta";
Console.WriteLine("Good Morning" + name);
}

20 / 20

Category: Initialization of Variables in C#

What will be the output of the following C# code?

int a,b;

a = (b = 10) + 5;

Your score is

The average score is 0%

0%

1

Instruction:

Total number of questions : 20

Time allotted : 20 minutes.

Each question carry 1 mark, no negative marks.

C # Quiz Part -03

Instruction:

Total number of questions : 20

Time allotted : 20 minutes.

Each question carry 1 mark, no negative marks.

C # Quiz Part -03


C Sharp

C # Quiz -3

C Sharp Quizzes for Freshers

1 / 20

Category: Char Types and String Literals in C#

What will be the output of the following C# string? (Enter a String : BOMBAY).

static void Main(string[] args)
{
string Str, Revstr = " ";
int Length;
Console.Write("Enter A String : ");
Str = Console.ReadLine();
Length = Str.Length - 1;
while (Length >= 0)
{
Revstr = Revstr + Str[Length];
Length --;
}
Console.WriteLine("Reverse String Is {0}", Revstr);
Console.ReadLine();
}

2 / 20

Category: Char Types and String Literals in C#

Verbatim string literal is better used for?

3 / 20

Category: Char Types and String Literals in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
string s1 = "Delhi";
string s2;
s2 = s1.Insert (6, "Jaipur");
Console.WriteLine(s2);
}

4 / 20

Category: Char Types and String Literals in C#

Which is the String method used to compare two strings with each other?

5 / 20

Category: Char Types and String Literals in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
char c = 'g';
string s = c.ToString();
string s1 = "I am a human being" + c;
Console.WriteLine(s1);
Console.ReadLine();
}

6 / 20

Category: Char Types and String Literals in C#

What will be the output of the following C# code?

 

string s1 = " I AM BEST ";
string s2;
s2 = s1.substring (5, 4);
Console.WriteLine (s2);

7 / 20

Category: Initialization of Variables in C#

Storage location used by computer memory to store data for usage by an application is?

8 / 20

Category: Initialization of Variables in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
int a = 5;
int b = 10;
int c;
Console.WriteLine(c = a-- - ++b);
Console.WriteLine(b);
Console.ReadLine();
}

9 / 20

Category: Floating and Decimal Data Types in C#

A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?

10 / 20

Category: Floating and Decimal Data Types in C#

Select a convenient declaration and initialization of a floating point number

11 / 20

Category: Floating and Decimal Data Types in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
int x = 1;
float y = 2. 4f;
short z = 1;
Console. WriteLine((float) x + y * z - (x + = (short) y) );
Console. ReadLine();
}

12 / 20

Category: Floating and Decimal Data Types in C#

The Default value of Boolean Data Type is?

13 / 20

Category: Scope and Lifetime of Variables in C#

Select differences between reference type and value type:

i. Memory allocated to ‘Value type’ is from heap and reference type is from ‘System. ValueType’
ii. Memory allocated to ‘Value type’ is from ‘System. ValueType’ and reference type is from ‘Heap’
iii. Structures, enumerated types derived from ‘System. ValueType’ are created on stack, hence known as ValueType and all ‘classes’ are reference type because values are stored on heap

14 / 20

Category: Scope and Lifetime of Variables in C#

What will be the output of the following C# code?

class Program
{
public static void Main(string[] args)
{
int i = 100;
for (a = 0; a < 5; a++)
{
int i = 200;
Console. WriteLine(a * i);
}
Console. ReadLine();
}
}

15 / 20

Category: Scope and Lifetime of Variables in C#

What will be the output of the following C# code?

class Program
{
static void Main(string[] args)
{
int i ;
for (i = 0; i < 5; i++)
{
Console.WriteLine(i);
}
Console.ReadLine();
}
}

16 / 20

Category: Scope and Lifetime of Variables in C#

What will be the output of the following C# code?

static void Main(string[] args)
{
int i ;
for (i = 0; i < 5; i++)
{
int j = 0;
j += i;
Console. WriteLine(j);
}
Console. WriteLine( i * j);
Console. ReadLine();
}

17 / 20

Category: Scope and Lifetime of Variables in C#

Choose effective differences between ‘Boxing’ and ‘Unboxing’.

18 / 20

Category: Scope and Lifetime of Variables in C#

What will be the output of the following C# code?

public static void Main(string[] args)
{
int i = 123;
object o = i;
i = 456;
System. Console. WriteLine("The value-type value = {0}", i);
System. Console. WriteLine("The object-type value = {0}", o);
Console. ReadLine();
}

19 / 20

Category: Data Types, Variables and Operators

Choose “.NET class” name from which data type “UInt” is derived?

20 / 20

Category: Data Types, Variables and Operators

Correct Declaration of Values to variables ‘a’ and ‘b’?

Your score is

The average score is 35%

0%