1/17
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What is the difference between declaration and initialization in C++?
Declaration allocates memory space, while initialization assigns an initial value.
What does the C++ declaration 'int count;' do?
It declares a variable 'count' of type integer.
What is the purpose of the 'const' keyword in C++?
It marks a variable as a constant, meaning it cannot be modified after initialization.
What is the output operator in C++?
The output operator '<
How do you read user input in C++?
Using the extraction operator '>>' with 'cin'.
What is the issue with using 'cin' followed by 'getline()'?
The trailing newline left in the input buffer can cause 'getline()' to read an empty line.
How can you fix the newline buffer issue in C++?
Use 'cin.ignore()' to flush the newline buffer before calling 'getline()'.
What happens during integer division by zero in C++?
It causes a runtime crash (floating-point exception).
What is the result of floating-point division by zero in C++?
It returns special IEEE values like 'inf' (infinity) or 'nan' (not a number).
What does the increment operator '++' do?
It adds 1 to the variable.
What is the purpose of compound assignment operators in C++?
They perform an operation and reassign the result to the variable.
What is explicit type casting in C++?
It converts an expression to a specified type using 'static_cast
What is the function of 'pow(x, y)' in
It raises x to the power of y (x^y) and returns a double.
What does 'sqrt(n)' return in
It returns the square root of n (√n).
What does 'fabs(n)' do?
It returns the absolute value of a floating-point number |n|.
What does the escape sequence '\n' do in C++?
It inserts a new line in a string literal.
How do you display a literal double quote in a string in C++?
Use the escape sequence '"'.
What does the escape sequence '\\' represent?
It displays a single backslash in a string.