Identify and correct the errors in each of the following pieces of code. [Note: There may be more than one error in each piece of code.]

```
a) if (age >= 65);
{
Console.WriteLine("Age greater than or equal to 65");
}
else
{
Console.WriteLine("Age is less than 65)";
}
b) int x = 1, total;
while (x <= 10)
{
total += x;
++x;
}
c) while (x <= 100)
total += x;
++x;
d) while (y > 0)
{
Console.WriteLine(y);
++y;
```


a) The semicolon at the end of the if condition should be removed. The closing double quote of the second Console.WriteLine should be inside the closing parenthesis.
b) The variable total should be initialized to zero.
c) The variable total should be initialized to zero.
d) The ++ operator should be changed to --; otherwise the loop will be an infinite loop if y is greater than 0 when the while statement is encountered. The closing curly brace for the while loop is missing.

Computer Science & Information Technology

You might also like to view...

____________________is online jargon for "Internet etiquette."

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Options can be displayed from the ________ view

Fill in the blank(s) with correct word

Computer Science & Information Technology

With the ____________________ Tool in the Camera Raw dialog box, anything outside of the newly created borders of any image will be cropped.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The ______________ option starts Windows normally and creates a log file of the drivers as they are loaded into memory.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology