Question Text

1.

Predict the output of the following program. using System; namespace Arrays_1 { class Program { static void Main(string[] args) { int i; if ((i = 10 / 2) = 0) Console.WriteLine("Even Number"); else Console.WriteLine("Odd Number"); Console.Read(); } } }

Options 1. 2. 3. It will give an error. It will print Odd Number. It will print Odd Number Even Number It will print Even Number.

4.

Question Text

2.

Consider the following code snippet: using System;

class Break { public static void Main(string[] args) { const char White ='W'; const char Gray ='G'; char ch; for (int count = 0; count < 5*2 - 1; count++) { ch = White; for (int j = 2; j < count; j++) { if (count % j == 0) { ch = Gray; } Console.WriteLine(ch); break; } } Console.ReadLine(); } } Identify the output of the preceding code.

Options 1. The output is: W G W G W G Compilation error The loop will run till infinity The output is: W G W

2. 3. 4.

G

Question Text

3.

Consider the following code using System; namespace Arrays_1 { class Program { static void Main(string[] args) { int[] arrayFirst = { 10, 20, 30, 40, 50 }; int[] arraySecond= {1 , 2, 3, 4, 5}; int[] arraythird= new int[5]; int counter = 0; //Line 1 for (counter = 0; counter < 5; counter++) //Line 2 { arraythird[counter] = arrayFirst[counter] + array[counter]; //Line 3 } for (counter = 0; counter < 5; counter++) //Line 4 Console.WriteLine("{0}", arraythird[counter]); Console.ReadLine(); } } } Identify the error

Options 1. 2. 3. 4. Line Line Line Line 1 2 3 4

Question Text

4.

Consider the following statements: Statement A: The reference types data types do not maintain the data but they directly contain a reference to the variables, which are stored in the memory. Statement B: In the reference types data types, if the value in the memory location is modified by one of the variables, the change is reflected in the other variables automaatically. Identify whether the preceding statements are true or false.

Options 1. 2. 3. 4. Both statement A and B are true Statement A is true and B is false Statement A is false and B is true Both statement A and B are false

Question Text

5.

Consider the following code and identify the error. using System; namespace Struct { struct distance { public int feet; public float inches; };

5. float W = r1.Length. 4.WriteLine("The Dining Area is {0}".5F.ReadLine(). namespace Const2 . 2. Identify the output of the following code.feet = 10. //Line 4 float L = r1.feet + r1. Console. L * W).Width. //Line 1 r1.Width. 3.struct room { public distance Length.Width.inches = 6.inches / 12. //Line 3 r1. public distance Width.Length. } } } Options 1. Console. Line Line Line Line 1 2 3 4 Correct Answer: -> 4 ************************************************************************************* Question Text 6. }.feet = 10.Length.Length.Width. r1. class Program { static void Main(string[] args) { room r1 = new room(). using System.inches / 12.inches = 8.feet + r1. //Line 2 r1.

3. P1.get_count ()).WriteLine("P2= {0}".P2. 2. } public void inc_count() { count++. P2. public Program() { count = 1. Console.ReadLine(). Program P2 = new Program(). } } class count_class { static void Main(string[] args) { Program P1 = new Program().inc_count(). } } } Options 1. 4. } public int get_count() { return count. P1= 1 P2= 2 P1=1 P2=1 P1=2 P2=2 Compilation error .inc_count().get_count ()).P1.WriteLine("P1= {0}". Console. Console.{ class Program { public int count.

Identify the error in the preceding code.WriteLine("Enter the name of the watch you want to buy"). 4. Watch_Name = Convert.ReadLine()).ToInt32(Console.WriteLine("Enter the price within which you want to buy the watch").Correct Answer: -> 1 Question Text 7.ReadLine()). Watch_Price=Convert. The The The The variable Watch_Price needs to be string variable. naming of variable Watch_Name is incorrect. Consider the following code: using System. 3. variable Watch_Name needs to be string variable. } } The preceding code when executed shows the error. Options 1. Correct Answer: -> 2 Question Text 8. naming of variable Watch_Price is incorrect. 2. . int Watch_Price. Console. class Watches { public static void Main(String[] rags) { char Watch_Name.ToChar(Console. Console.

5. i++) result = result + nums[i]. 11. result / 5).consider the following code. 13.3. using System. Console. Options 1. 2. int i. 12. i < 5.0.5 Correct Answer: -> 1 Question Text 9.1. class Weight { . namespace Arrays1 { class Program { static void Main(string[] args) { double[] nums ={ 10. Console.2.WriteLine("The result is {0}". } } } Predict the Output of the preceding code. double result = 0.4 }.ReadLine(). 4. The result is 11.5 Compilation error The result is 13.5 The result is 12. 10. Predict the output of the following code: using System. for (i = 0. 3.

lbstokg(182).553741 82 82. } double lbstokg(double pounds) { double kilograms = 0.ReadLine()). 3. Consider the following code: using System. . 2. kgs = K1. 4.ReadLine(). Vegetable_Name = Convert.55 82. return kilograms.public static void Main(string[] args) { Weight K1 = new Weight().WriteLine("Enter the name of the vegetable you want to buy"). int Vegetable_Amount.453592 * pounds.WriteLine("Your weight in Kilograms is: {0}". Console. } } Options 1. class Vegetables { public static void Main(string[] args) { string Vegetable_Name. Console. kgs).5537 Correct Answer: -> 1 Question Text 10.ToInt32(Console. double kgs. Console. Your Your Your Your weight weight weight weight in in in in Kilograms Kilograms Kilograms Kilograms is: is: is: is: 82.

ToInt32(Console. 4. Console. To convert the int variable the programmer should write the following statement: Vegetable_Name = Convert. 3. Options 1. using System. } } The preceding code when executed shows the error. Predict the out put of the following program.Console. To convert the string variable the programmer should write the following statement: Vegetable_Name = Convert. The error is in the conversion of the variable Vegetable_Name. class AddNumbers { class Calculator .ToChar(Console.ReadLine().Readline()).ToInt32(Console. The error is in the conversion of the variable Vegetable_Name. The error is in the conversion of the variable Vegetable_Name. Correct Answer: -> 1 ************************************************************************************* Question Text 11.Readline()).Readline(). To convert the string variable the programmer should write the following statement: Vegetable_Name = Convert.Readline()). Identify the error form the preceding code and rectify it. 2.WriteLine("Enter the amount of the vegetable you want to buy"). To convert the string variable the programmer should write the following statement: Vegetable_Name = Console.ToDouble(Console.ReadLine()). The error is in the conversion of the variable Vegetable_Amount. Vegetable_Amount = Convert.

WriteLine(number). } public static void Main() { Calculator obj = new Calculator(). 2. Identify the component of the . Console. 2. 3.NET Framework Base Classes The user and program interfaces Web Forms .AddOne(number). obj. Common Language Runtime . Console. 3. ++var. var++.{ void AddOne(int var) { var++. Options 1. } } } Options 1. 4.Read(). 6 8 9 7 Correct Answer: -> 1 ************************************************************************************* Question Text 12. int number = 6.NET Framework which allows the execution of code across different platforms by translating code into Intermediate Language. 4.

ReadLine(). int[] arraythird= new int[5]. 5}. Console. for (counter = 0. Options 1.Correct Answer: -> 1 Question Text 13. 20. } } } Predict the output of the preceding code. counter < 5. Consider the following code: using System. 4. 30. counter++) Console. counter < 5. int counter = 0. 50 }. } for (counter = 0. 3. namespace Arrays_1 { class Program { static void Main(string[] args) { int[] arrayFirst = { 10. 40. 11 22 33 44 55 . 2. arraythird[counter]). counter++) { arraythird[counter] = arrayFirst[counter] + arraySecond[counter].WriteLine("{0}". int[] arraySecond= {1.

//Line 2 int i. result / 5). Identify the line. 10 20 30 40 50 1 2 3 4 5 Compilation error Correct Answer: -> 1 Question Text 14. i++) //Line 3 result = result + nums[i]. } } } Options 1. which will generate an error in the following program.0. 4.2. 3. namespace Arrays_1 { class Program { static void Main(string[] args) { double[] nums. Line 4 . using System. i < 5. for (i = 0.WriteLine("The result is {0}". //Line 4 Console. //Line 1 double result = 0.

p1. 4.Min(10. Console.WriteLine("{0}". } } public Boolean Min(float num1.2. namespace Fun_1 { class Program { public int Min(int num1. 10)). else return false. } class test { static void Main(string[] args) { Program p1 = new Program(). 2)). using System. int num2) { if (num1 > num2) { return num1.ReadLine(). float num2) { if (num1 > num2) return true. } . Console. 3. Console. } else { return num2.Min(20.WriteLine("{0}". Line 2 Line 3 Line 1 Correct Answer: -> 1 Question Text 15. p1. Consider the following code and predict the output.

Correct Answer: -> 1 Question Text 16. 4. } } class Test { .} } } Options 1. Determine the output of the following code: class Base { ~Base() { Console. It will print 10 20 It will print 10 It will print 20 10 Compilation error 2. 3.WriteLine("Destroying Derived").WriteLine("Destroying Base"). } } class Derived : Base { ~Derived() { Console.

} } Options 1. 4. } public void Divide(int number1.static int Main(string[] args) { Base obj = new Derived(). int number2) { try { result = number1 / number2. Predict the output of the following program. It will print: Destroying Base Destroying Derived It will print: Destroying Derived Destroying Base It will print: Destroying Base It will print: Destroying Derived 2. Console. 3. . AddNumbers() { result = 0. Correct Answer: -> 2 *********************************************************************************** Question Text 17.Read(). class AddNumbers { int result. return 0.

{0} ". } Options . } } Options 1. will throw Zero division exception. contains a Syntax error.i). Console. 3.WriteLine ("{0}". Identify the type of error in the following code snippet. while(i<=10) Console.} catch (DivideByZeroException e) { Console.WriteLine("Result is {0}". static void Main() { int i=1. 2. 5). Program Program Program Program will print "Result is 2".Divide(10. 4. } } public static void Main(string[] args) { AddNumbers Division = new AddNumbers(). Division. } finally { Console. contains a Logical error. result). e).WriteLine("Exception caught.ReadLine(). i++. Correct Answer: -> 1 Question Text 18.

Determine the output of the following code: using System. 4. } } class BaseDerived : Derived { public BaseDerived() { Console. } } class Test { static int Main(string[] args) { Derived obj = new BaseDerived(). 2. . return 0.WriteLine("Constructor of Derived").WriteLine("Constructor of Base"). Console. } } class Derived : Base { public Derived() { Console. class Base { public Base() { Console.WriteLine("Constructor of BaseDerived").Read(). 3. Syntax error Run-Time error Logical error Zero division error Correct Answer: -> 3 Question Text 19.1.

3.} } Options 1. 4. return arg.i++. } } class TestClass { static void Main(string[] args) . Correct Answer: -> 1 ************************************************************************************* Question Text 20. } public static NumberCount operator ++(NumberCount arg) { arg. Constructor Constructor Constructor Constructor Constructor Constructor Constructor Constructor Constructor Constructor Constructor Constructor of of of of of of of of of of of of Base Derived BaseDerived BaseDerived Derived Base Base BaseDerived Derived BaseDerived Base Derived 2. public NumberCount(int initval) { this. Predict the output of the following program.i = initval. struct NumberCount { public int i.

WriteLine(Count1.{ NumberCount Count1 = new NumberCount(1). Console.WriteLine(Count2. NumberCount Count2 = Count1++.WriteLine(Count2.i). will print: 4. Console. Console. Console. will print: 3. } } Options 1.i). Count2 = ++Count1.i). It 1 2 3 3 It 3 3 1 2 It 2 1 3 3 It 2 1 3 2 will print: 2. Console.WriteLine(Count1.ReadLine(). will print: .i).

Correct Answer: -> 4 Question Text 22. public Program(int i) { age = i. It It It It will will will will print the name and age entered by the user in the same line. p. Console. Analyse the following code and choose the most appropriate option.Write("Enter name: "). 4.Correct Answer: -> 3 Question Text 21. int age. Predict the output of the following program.ToInt16(Console. 3. 2. } static void Main(string[] args) { Program p = new Program(). give an error. Console. } } Options 1.WriteLine("Name: {0}".age=Convert. print the name and age entered by the user in the different lines. Console.WriteLine("Age: {0}". class Program { String name. . p.name). print the name as entered by the user but the age will be printed as 0.age).ReadLine()).p.

3.Read ).Analyze the following code and select the most appropriate option. using System.txt". Options 1. 4.IO. Sam has created the following program to read the contents of a file. public delegate void TimeToRise(). ch=Convert.Write("{0}". FileAccess. class Program { static int Main(string[] args) { char ch. Correct Answer: -> 3 Question Text 24. Student class subscribes to the event named TimeToRise. During the execution of the program he found that only a single character is repeatedly displayed on the console and the program runs into an infinite loop. while (ch != -1) Console. The The The The Student class subscribes to the method named WakeUp. Student PD= new Student().Open . StreamReader sr = new StreamReader(fs).ch). FileMode. FileStream fs = new FileStream(@"c:\preeti\myfile. RingAlarm event is initialized with the WakeUp method. .WakeUp). RingAlarm = new TimeToRise(PD.Read()). TimeToRise class subscribes to the event named Student. private event TimeToRise RingAlarm.ToChar(sr. using System. Find the possible cause of the error. 2.

It should contain the read statement also. Correct Answer: -> 3 Question Text 25.Substring(9. The while loop is causing the error. Convert. Text file cannot be read through the Read function. while ( Console. return 0. 2. using System.Now). 4.ToString(DateTime.Read() != 'q' ) { . myTimer. } } public static void DisplayTimeEvent( object source.Console. myTimer.Start().8)).Elapsed += new ElapsedEventHandler( DisplayTimeEvent ). The end of file should be checked by writing (ch!=null).Write("\r{0}".Interval = 1000. using System.Timers. class myApp { public static void Main() { Timer myTimer = new Timer().Read(). The ReadLine() function should be used in place of Read() function. ElapsedEventArgs e ) { Console. Analyze the following code and predict the output. . myTimer. 3. } } Options 1.

Subclass Super Class Class Abstract Class Correct Answer: -> 4 Question Text 27. Which type of class is the candidate class? Options 1. using System. Correct Answer: -> 1 ************************************************************************************* Question Text 26. public class MyClass . the current time on the console. He is using this class as a super class only. 4. the current date on the console. 3. 2. It It It It will will will will display display display display a digital clock (running) on the console. 2. 3. He is following the OOPS concept. 4. He is not creating any object of this class.} } Options 1. an error. He has created a general class named Candidate. A programmer is developing software for a recruitment company. Analyse the following program and predict the output.

y=b.Write(t. print give an error. int b) { float x.WriteLine(t. 4. Console.y.5 5 It will 5 2. It will 5 2. int b) { return a/b. } public static void Main() { testing t=new testing(). } public float Division(int a. Console. x=a.5 It will print 2. Console.Division(5 /2)). } } } Options 1. .Read(). print 3. return x / y.{ class testing { public int Division(int a.Division(10.2)).5 It will 2. Correct Answer: -> 4 Question Text 28.

3. RingAlarm = new TimeToRise(PD. delegate that subscribe to an event must be declared as Void. delegate and the event both should either be public or private. using System. Student PD= new Student(). Find out the error in the following program.Creating Child thread"). Options 1. The The The The event should be declared as Public.Threading.WriteLine("Main . Identify the error in the following code snippet.WakeUp). . Correct Answer: -> 4 Question Text 33. class AddNumbers { public static void ChildThreadCall() { Console.WriteLine("Testing threads"). using System. public delegate int TimeToRise(). Console. 2. 4.Correct Answer: -> 1 Question Text 32. } public static void Main() { ThreadStart ChildRef = new ThreadStart(ChildThreadCall). private event TimeToRise RingAlarm. delegate should be declared as Private.

} } Options 1. 3. Console.Thread ChildThread = new Thread(ChildRef). Abort() method should not be called after the Start() method.Abort(). The The The The ChildThreadCall() method should be declared as Private.Start(). 3. ChildThread. 4. To use a variable num for storing a numeric value without any fractional part. start() method should not be called after the Abort() method. ChildThread. Start() method should be called after the Sleep() method. 4. The complexity of a program can be reduced by creating: Options . 2. char numeric float positive Correct Answer: -> 2 ************************************************************************************* Question Text 35. ChildThread. 2. Correct Answer: -> 4 ************************************************************************************* Question Text 34.Start(). the variable num must be declared and it should be of the type: Options 1.ReadLine().

will give error. string s1. will read a string "hello". .Console. class demo { public static void Main(string[]args) { bool compare. 2.s2. 4. } } Options 1. Give the output of the following program: using System. 4. Correct Answer: -> 2 Question Text 37. Give the output of the following: public class abc { public void Main(string[] args) { System.WriteLine("hello"). 3. s1 = "Welcome". 2. will give the output "hello".1. Statements Functions Structured programs Variables Correct Answer: -> 2 Question Text 36. 3. compile successfully but no output is displayed.

WriteLine("{0}". while(b < 100) { Console.WriteLine("{0}".a). a = a-b.WriteLine(compare.WriteLine( b).WriteLine(b). b=b+a. b = b++.WriteLine("{0}".ToString()). b=b+a. 3. False will be displayed because both the expressions are false. Options 1. The The The The message message message message False will be displayed because both the expression are true. a=b-a. 3. a=b-a. } Console. } } Options 1.a). Console. while(b>100) { Console. } Console. 2. while(b<100) { Console.s2 = "NIITians". Correct Answer: -> 4 Question Text 38. . True will be displayed because one expression is false. compare=(s1=="Hello")^(s2=="NIITians").a). Console.WriteLine( b). True will be displayed because both the expressions are false. 4. Which of the following code snippet will be used to print a Fibonacci series unto 100 when a=b=1. 2.

> < method name > { parameter list} 4. Which of the following is the correct structure to define a method: Options 1. Give the output of the following program: . a=a--.a). > < method name > [parameter list] 3. } Correct Answer: -> 1 Question Text 39.WriteLine("{0}". while(b<100) { Console. } Console.4. < return type > < access specifier { method body } < return type > < access specifier { method body } < access specifier > < return type { Method body } < access specifier > < return type { Method body } > < method name > (parameter list) 2.WriteLine( b). b=b+a. > < method name > (parameter list) Correct Answer: -> 4 ************************************************************************************* Question Text 40.

obj. } Which of the following option will define the implementation of method show() in class b? Options 1.one() can't be declared with a body since it is marked abstract. Sealed is an unrecognized keyword. No message will be displayed.using System. } } class inherit_demo1 { public static void Main() { a obj = new a(). 2. 3. Consider the following code snippet: abstract class a { public abstract void show(). Correct Answer: -> 3 Question Text 41. } } Options 1. sealed class a { public abstract void one() { Console.WriteLine("you are in sealed class"). 4. class b:a { public override void show() { . The program will give error because a. It will display a message "you are in sealed class".one().

Console. Console. Options . 4.WriteLine("you are in class b").show().WriteLine("you are in class b"). 3. the above class definition is wrong.2.WriteLine("you are in class b"). obj. Give the correct class definition. He does so using the following class definition: class emp { string e-name. Mr. } Correct Answer: -> 1 Question Text 42. void accept-details() {} void display-details() {} } However. Joe wants to store the details of all the employees. } class b:a { private override void show() { Console. int e-id. } } class b:a { public void show() { a:s(). } class b { public void show() { a obj = new a().

} void display_details() . int eid.1. void accept_details[] {} void display_details() {} } } class emp { { void accept_details() { string name. class emp { { string name. } void display-details() { string name. 2. int eid. } } } class emp { string e_name. void accept_details() {} void display_details() {} } class emp { void accept_details() { string name. int e_id. 3. int eid. 4. int eid.

m1).dec}. 3.ReadLine(). Console.mar. Console.feb. Give the output of the following program.dec. namespace s { class enum_demo { enum e{jan. int eid.{ string name. } } Correct Answer: -> 3 ************************************************************************************* Question Text 43. 4. Give the output of the following program: . 2. static void Main(string[] args) { int m1=(int)e.WriteLine("Dec={0}". Dec=12 Dec = 4 Dec = 3 Dec = 0 Correct Answer: -> 3 Question Text 44. } } } Options 1. using System.

1 2 0 0 1 1 0 0 2.id=i.id).ReadLine(). .WriteLine(e1. Console.using System. } static public emp operator --(emp e) { e.WriteLine(e1. } } class over_demo { static void Main(string[] args) { emp e1=new emp(2). Console.id). emp e2 = --e1. } } } Options 1. public emp(int i) { this. return e.WriteLine(e2. namespace OperatorOverload { struct emp { public int id. Console. e2=e1--.WriteLine(e1.id--. Console.id).id). Console.

Correct Answer: -> 3 . Dec 3 It will display the message.3.dec. Give the output of the following program: using System. namespace s { class enum_demo { enum e{jan. 3.m1). } } } Options 1. The program will compile but no message will be displayed. 4. 4.feb. 2 1 0 0 2 2 0 0 Correct Answer: -> 2 Question Text 45.dec}.ReadLine().mar. Console. Console.WriteLine("{0}". 2. Can't convert type 's.e' to string. static void Main(string[] args) { string m1=(string)e.enum_demo.

DData(MlDelegate). Give the output of the following code: using System. internal static over operator++ (over x) {} static static over operator++ (over x) {} private static over operator++ (over x) {} public static over operator++ (over x) {} Correct Answer: -> 4 ************************************************************************************* Question Text 47. public static void WC (String str) { Console. namespace dele { public class dele_demo { public delegate void PData(String s). 2.IO. } public static void DData(PData PMethod) { PMethod("This should go to the"). using System. 4. } public static void Main() { WC MlDelegate = new WC(PData). Which of the following code snippet is syntactically correct according to the rules applied for declaring the prefix and postfix notations for operator overloading? Options 1.str). 3.WriteLine("{0} Console".Question Text 46. .

4. display "This should go to the". public delegate hello(). private event ehello hello(). 4. private event delegate ehello(). Correct Answer: -> 4 Question Text 48. public delegate void hello(). 2. Choose the correct code to define the event named 'ehello' that invokes a delegate named 'hello' Options 1. display "This should go to the console". private event hello ehello(). Which of the following statement is correct in context to static constructor? Options 1. Correct Answer: -> 4 Question Text 49. public delegate void hello(). private event delegate ehello(). 2. give compilation error. . Static constructors are used for initializing both static and non-static variables of a class. 3. public delegate hello(). Static constructors are used only by static classes to initialize their variables. 3. It It It It will will will will compile successfully but generate a runtime error. 2.} } } Options 1.

4. It will display: destructor can not be defined before constructor It will display: you are in destructor It will display: you are in constructor It will give compilation error. The static constructors have an implicit public access.WriteLine("you are in constructor"). } public static void Main(string[] args) { life_demo obj = new life_demo(). Correct Answer: -> 4 Question Text 50. 4.WriteLine("you are in destructor"). The static constructors have an implicit private access. Correct Answer: -> 2 ************************************************************************************* Question Text 51. . namespace o { class life_demo { ~life_demo() { Console. } } } Options 1. 3. 2. } life_demo() { Console. Give the output of the following program: using System.3.

Console. Identify the code snippet that will help perform the desired task.WriteLine("Enter the String:").FileMode. using System. obj. s.Close(). string s1 = Console. s. errors generated during the process of dereferencing a null object. 4. FileStream f = new FileStream("abc.Write). } public static void Main(string[] args) { file_demo obj = new file_demo(). class file_demo { public void accept() { FileStream f = new FileStream("abc.FileMode. StreamWriter s = new StreamWriter(f).WriteLine("Enter the String:"). 2.System.accept().Append. StreamWriter s = new StreamWriter(f). Console.IO. The following code was written to write in a file named "abc. f. memory allocation to the application errors. s.Close().txt". . Correct Answer: -> 3 Question Text 52. 3. using System.txt".ReadLine(). } } Options 1.txt"). I/O errors. errors generated when method refers to an array element.Flush().NullReferenceException exception class handles : Options 1. The code is not performing the desired task.Write(s1).

Write). StreamWriter s = new StreamWriter(f).kernel32.string s1 = Console. Thread 'b' wants to assign value 10 to the variable x. It will import the unmanaged code residing in Dll to kernel. 4. Console.ReadLine(). Thread 'b'.WriteLine("Enter the String:"). Correct Answer: -> 4 Question Text 53.FileMode. 4. DeadLock . 3. 2.txt".FileMode. It will call the unmanaged code defined in kernel from managed C# environment.WriteLine().FileMode.txt".WriteLine(). FileWriteStream f = new FileWriteStream("abc. Identify the situation being referred to in the above statement. 2. It will call the unmanaged code defined in Dll from managed C# environment. FileStream f = new FileStream("abc. It will call and import the unmanaged code residing in kernel to Dll. Consider the following statement: Thread 'a'.WriteLine("Enter the String:").Write).Append.Append. FileWriteStream f = new FileWriteStream("abc.FileMode. and Thread 'c' are accessing variable ' x' simultaneously. Console. Console. StreamWriter s = new StreamWriter(f).txt". Correct Answer: -> 2 Question Text 54. What is the purpose of the following line of code: [DllImport(. string s1 = Console. 3.WriteLine("Enter the String:"). StreamWriter s = new StreamWriter(f). Options 1.Write).Append.FileMode.ReadLine().FileMode. string s1 = Console. string s1 = Console.dll)] Options 1.