Question: Rewrite the following code, using only if statements (NO else). There is an error in the file-access portion of the code. What is it, and

Rewrite the following code, using only if statements (NO "else"). There is an error in the file-access portion of the code. What is it, and why is that an issue?: bool a = false, b = false: int c = 0, d = 0: if (a == true && b == false && c == 1 && d == 0) { StreamWriter writer1 = null: writer1 = new StreamWriter("C: \OutputWritel.txt"): Console.SetOut(writer1): Console.WriteLine("True"): } else { StreamWriter writer2 = null: writer2 = new StreamWritert("C: \OutputWrite2.txt"): Console.SetOut(writer2): Console.WriteLine("False"): }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
