using System;
class Test{
public static void Main()
{
int value = Int32.Parse("99953");
double dval=Double.Parse("1.3433E+35");
Console.WriteLine(value);
Console.WriteLine(dval);
}
};
What will be the ouput of above code when compiled/run?
A -
The output of above code will be: 99953 1.3433E35
B -
The output of above code will be: 9953 1.3433E+35
C -
The output of above code will be: 9953 1.3433
D -
The code will generate compile time error
2-
using System;
class Test {
static void Main() {
int @Main;
int[] Static = new int[3]
@Main = 100*Static[1];
Console.WriteLine(@Main);
}
}
A -
The code cannot compile
B -
The code will display 0
C -
The code will display 100
D -
The code will return an error
3-
using System;
class Test{
public static void Main()
{
int[] Array1 = {3, 2, 1};
Display1(Array1);
Array.Sort(Array1);
Display1(Array1);
}
static void Display1(Array pArray)
{
foreach(int t in pArray){
}
}
}
What will be the ouput of above code?
A -
The ouput of code will be: 3 2 1 1 2 3
B -
The code will generate an error compile time since the Sort() function of Array returns an integer number
C -
The ouput of the code will be: 321123
D -
#
4-
Using System.Collections;
class Indexing{
public Hashtable Dictionary = new Hashtable();
public string this[string Name]
get {
return (string) Directionary[Name];
}
set {
Dictionary[Name] = value;
}
}
}
class Test {
static void Main() {
Indexing Index1 = new Indexing();
Index1["CA"] = "CALIFORNIA;
Index1["AM"] = "AMERICA";
Systen.Console.WriteLine(Index1["AMERICA"]);
}
}
What will be the output of above code when compiled/run?
A -
The code will compile successfully and output of code will be: AMERICA
B -
The code will generate a compile time error
C -
The code will compile successfully and output of code will be:AM
D -
The code will compile successfully but does not display any output
5-
We invoke method ____ to determine # local variable index.
A -
IndexOf
B -
Position
C -
IndexOfString
D -
Index
6-
We use operator ____ when it makes an application clearner than accomplishing the
same operations with explicit method calls.
A -
constructor
B -
overriding
C -
overloading
D -
None of the above
7-
Using System;
class Question{
public static void Main() {
for (int i=0;i<10;i++) {
try{
if(%3==0) throw.new Exception("EO");
try{
if(i%3= =11) throw new Exception("E1");
Console.WriteLine(i);
} catch (Exception inner) {
i+=3;
finally (++i;)
//try2
catch (Exception outer)
{
i+=3;
}finally (++I;)
}
}
}
Which of the following lines does the above program display?
A -
5 8
B -
4 5
C -
8 5
D -
#
8-
What setting of the Dock peoperty wll #
A -
None, you should use the Anchor property
B -
Top
C -
Top, Left, Right, Bottom
D -
Fill
9-
What does the following code segment display?
for (t=0;t<3;++ t)
Console.Write(t);