12>>
1.

What is the output for the following set of code?

public static void Main(string[] args)
{
double ZERO = 0;
Console.WriteLine("RESULT OF DIVISION BY ZERO IS :{0}", (0 / ZERO));
Console.ReadLine();
}


A) None of the mentioned

B) Exception argument is thrown

C) NaN

D) 0



2.

What is the default value of Boolean DataType?


A) 0

B) true

C) false

D) 1



3.

What is the output of the following set of 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();
}


A) 0.4000006

B) 0.4000024

C) 0.0400022

D) 0.4000001



4.

Which set of code will return the value of given variable ‘c’ as ‘25.302’.

a) float a = (double) 12.502f;
float b = 12.80f;
float c;
c = (float) a + b;
Console.Writeline(c);
Console.ReadLine();


b) float a = 12.502D;
float b = 12.80f;
float c;
c = a + b;
Console.WriteLine(c);
Console.ReadLine();


c) double a = 12.502;
float b = 12.802f;
float c;
c = (float)a + b;
Console.WriteLine(c);
Console.ReadLine();


d) double a = (float) 12.502f;
float b = 12.80f;
float c;
c = a + b;
Console.WriteLine(c);
Console.ReadLine();




5.

Which is the best way to define a value 5.28 in a variable ‘pi’ where value cannot be modified ?


A) #define pi 5.28F

B) pi = 5.28F

C) const float pi = 5.28F

D) const float pi; pi = 5.28F



12>>