Practice Quiz 7 - Operators & Expressions There are 10 questions in this quiz Question 1: Multiple Choice Which one of the following is the assignment operator? == =: = := Question 2: Multiple Choice Which one of the following is NOT an operator? += ++ int a % Question 3: Multiple Choice Which one of the following statements is false? int x = -3 - 4 * 2; //results in x having the value of -11 int x = (-3 - 4) * 2; //results in x having the value of -14 int x = -3 - 4 / 2; //results in x having the value of -3.5 int x = (-3 - 4) / 2; //results in x having the value of -3 Question 4: Multiple Choice Which one of the following is an increment operator? += ++ int a inc Question 5: Multiple Choice Consider the code below. 15 / 10; What is the datatype of the result of the operation? integer float char string Question 6: Multiple Choice Consider the code below. int x = 8; double y; y = x; What is the value of y? 8 16 16.0 8.0 Question 7: Multiple Choice Consider the code below. int x; double y = 10.2; x = (int) y; What is the value of y? 10.2 10 0.2 1 Question 8: Text Entry Consider the code below. x = 5 + 3 + 8 * 10 + 6 / 3; What is the value of x? Question 9: Text Entry Consider the code below. int var1 = 5; int var2 = 2; double result; result = 8 + var1 / var2 - 3; cout << "The result is: " << result; What is the value of result? Question 10: Text Entry Consider the code below. int x, y=3; double w= 10.2; x = (int) w * y; What is the value of x?
There are 10 questions in this quiz
Which one of the following is the assignment operator? == =: = :=
Which one of the following is the assignment operator?
Which one of the following is NOT an operator? += ++ int a %
Which one of the following is NOT an operator?
Which one of the following statements is false? int x = -3 - 4 * 2; //results in x having the value of -11 int x = (-3 - 4) * 2; //results in x having the value of -14 int x = -3 - 4 / 2; //results in x having the value of -3.5 int x = (-3 - 4) / 2; //results in x having the value of -3
Which one of the following statements is false?
Which one of the following is an increment operator? += ++ int a inc
Which one of the following is an increment operator?
Consider the code below. 15 / 10; What is the datatype of the result of the operation? integer float char string
Consider the code below.
15 / 10;
What is the datatype of the result of the operation?
Consider the code below. int x = 8; double y; y = x; What is the value of y? 8 16 16.0 8.0
int x = 8; double y; y = x;
int x = 8;
double y;
y = x;
What is the value of y?
Consider the code below. int x; double y = 10.2; x = (int) y; What is the value of y? 10.2 10 0.2 1
int x; double y = 10.2; x = (int) y;
int x;
double y = 10.2;
x = (int) y;
Consider the code below. x = 5 + 3 + 8 * 10 + 6 / 3; What is the value of x?
x = 5 + 3 + 8 * 10 + 6 / 3;
What is the value of x?
Consider the code below. int var1 = 5; int var2 = 2; double result; result = 8 + var1 / var2 - 3; cout << "The result is: " << result; What is the value of result?
int var1 = 5; int var2 = 2; double result;
int var1 = 5; int var2 = 2;
double result;
result = 8 + var1 / var2 - 3; cout << "The result is: " << result;
What is the value of result?
Consider the code below. int x, y=3; double w= 10.2; x = (int) w * y; What is the value of x?
int x, y=3; double w= 10.2; x = (int) w * y;
int x, y=3;
double w= 10.2;
x = (int) w * y;