Operators and Primitive Data Types

SharperTangent avatar
SharperTangent
·
·
Download

Start Quiz

Study Flashcards

20 Questions

What operator is used to add together two values?

Which keyword is used to store either True or False?

bool

What function is used to read a string or a line from an input stream?

getLine

Which function returns the length of the given wide string?

wcslen()

Which keyword is used to store a sequence of letters or other characters?

string

What is the operator used to decrease the value of a variable by 1?

--x

Which keyword is used to store whole numbers without decimals?

int

What is the function used to get the size of various data types?

sizeof()

What is used to set the decimal precision to be used to format floating point values on output operations?

setprecision()

Which keyword is used to store fractional numbers containing one or more decimals?

float

What is the typical bit width of a double variable?

8 bytes

When should the setprecision() function be used in the source code?

After the namespace std;

What is the purpose of the getline() function?

To read a line of text from an input stream and store it in a string variable

What does the void keyword indicate when used as a function return type?

The function doesn't return a value

What is the purpose of the putback function in C++?

To put a character back into the input stream

What does the array indexing start at in C++?

0

What is the purpose of the peek function in C++?

To read the next character from the input stream only

Which keyword specifies that a function takes no parameters?

void

What does unsigned int represent in C++?

Integer value that can only be positive

What is the maximum and minimum value that can be stored in a long double variable?

-1.7 x 10^308 to 1.7 x 10^308

Test your knowledge on operators, including addition, subtraction, multiplication, division, modulus, increment, and decrement, as well as primitive data types and arrays. This quiz covers the basic concepts and examples of using these operators and data types.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Operators in Programming Quiz
5 questions
Operators in Programming
18 questions

Operators in Programming

HeartwarmingDystopia avatar
HeartwarmingDystopia
Use Quizgecko on...
Browser
Browser