Identify and correct the errors in each of the following sets of code:
```
a) while (c <= 5)
{
product *= c;
++c;
b) if (gender == 1)
{
Console.WriteLine("Woman");
}
else;
{
Console.WriteLine("Man");
}
```
a. Error: The closing right brace of the while statement’s body is missing.
Correction: Add a closing right brace after the statement ++c;.
b. Error: The semicolon after else results in a logic error. The second output statement will always execute.
Correction: Remove the semicolon after else.
You might also like to view...
Which of the following is not a kind of inheritance in C++?
a. public. b. private. c. static. d. protected.
A remote procedure call (RPC) between processes on the same machine is called a(n) _______.
a) local remote procedure call (LRPC) b) local procedure call (LPC) c) deferred procedure call (DPC) d) asynchronous procedure call (APC)
If you want to know what your document would look like as a Web page, you need to use the ________
Fill in the blank(s) with correct word
Word provides all the commands necessary for you to publish your blog directly to the host server for your blog
Indicate whether the statement is true or false