Podcast
Questions and Answers
Which operator is used to find the remainder of an integer division?
Which operator is used to find the remainder of an integer division?
- % (correct)
- *
- //
- /
What is the value of the variable remainder
after executing the following code: int dividend = 5, divisor = 3; remainder = dividend % divisor;
?
What is the value of the variable remainder
after executing the following code: int dividend = 5, divisor = 3; remainder = dividend % divisor;
?
- 0
- 3
- 2 (correct)
- 1
Which of the following is the correct way to declare and initialize an integer variable called count
with a value of 10?
Which of the following is the correct way to declare and initialize an integer variable called count
with a value of 10?
- int count = '10';
- int count = 10; (correct)
- count = 10;
- count := 10;
What is the purpose of using parentheses in an arithmetic expression?
What is the purpose of using parentheses in an arithmetic expression?
Which of the following statements correctly uses the shorthand operator +=
?
Which of the following statements correctly uses the shorthand operator +=
?
What is the purpose of the cin
object in C++?
What is the purpose of the cin
object in C++?
Which of the following statements correctly uses the cout
object to output the value of an integer variable x
?
Which of the following statements correctly uses the cout
object to output the value of an integer variable x
?
What is the purpose of the flow of control
concept in programming?
What is the purpose of the flow of control
concept in programming?
What is the purpose of the branch
concept in programming?
What is the purpose of the branch
concept in programming?
Which of the following statements correctly initializes an integer variable count
with a value read from the user?
Which of the following statements correctly initializes an integer variable count
with a value read from the user?