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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!