Answers to Sample Test Questions

Chapter 1: Introducing the Programming in C# Certification

Chapter 1 has no chapter test questions.

Chapter 2: Basic Program Structure

1. You want to declare an integer variable called myVar and assign it the value 0. How can you accomplish this?
b. myVar = 0;
2. You need to make a logical comparison where two values must return true in order for your code to execute the correct statement. Which logical operator enables you to achieve this?
d. &&
3. What kind of result is returned in the condition portion of an if statement?
a. Boolean
4. What are the keywords supported in an if statement?
b. if, else, else if
5. In the following code sample, will the second if structure be evaluated?
bool condition = true;

   if(5 < 10)
       Console.WriteLine("5 is less than 10);
a. Yes
6. If you want to iterate over the values in an array of integers called arrNumbers to perform an action on them, which loop statement enables you to do this?
a. foreach (int number in arrNumbers){}
7. What is the purpose of break; in a switch statement?
b. It causes the code to exit the switch statement.
8. What are the four basic repetition structures in C#?
c. for, foreach, while, do-while
9. How many times will this loop execute?
int value = 0;
   Console.WriteLine (value); 
} while value > 10;
b. 1 time

Chapter 3: Working with the Type System

1. What is the maximum value you can store in an int data type?
d. 4,294,967,296 ...

Get MCSD Certification Toolkit (Exam 70-483): Programming in C# now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.