FlashKeepers

C and C++ · College · College and University

C I: Syntax and Types

C data types, operators, control flow, functions, scope, storage classes and the compilation model. Excludes pointers and file I/O.

About this set

40 basic cards for College C and C++. It opens with "What are the four basic data types in C?" and "What is the difference between signed and unsigned integer types?". Study it alongside the other College sets below.

40 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What are the four basic data types in C?
Show answerint, char, float, double
What is the difference between signed and unsigned integer types?
Show answerSigned can represent negative values, unsigned cannot but has a larger positive range
How do float and double differ in C?
Show answerfloat is single-precision (32-bit), double is double-precision (64-bit) and more accurate
How do you perform an explicit type cast in C?
Show answer(type) value, for example (int) 3.14 or (float) x
What keyword prevents a variable from being modified after initialization?
Show answerconst
What is the modulo operator % used for?
Show answerIt returns the remainder of a division operation
Name the three logical operators in C.
Show answer&& (and), || (or), ! (not)
What is operator precedence?
Show answerThe order in which operators are evaluated in an expression when no parentheses specify otherwise
How does the ternary operator ?: work?
Show answercondition ? value_if_true : value_if_false, it selects one of two values based on a condition
What are compound assignment operators?
Show answer+=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, they combine an operation with assignment
Name the six bitwise operators in C.
Show answer& (and), | (or), ^ (xor), ~ (not), << (left shift), >> (right shift)
What is the difference between = and ==?
Show answer= is the assignment operator, == is the comparison operator (tests equality)
What do the increment ++ and decrement -- operators do?
Show answerThey add or subtract 1 from a variable, respectively
List the six relational operators in C.
Show answer< (less than), > (greater than), <= (less or equal), >= (greater or equal), == (equal), != (not equal)
Explain short-circuit evaluation with && and ||.
Show answerWith &&, evaluation stops once a false is found. With ||, evaluation stops once a true is found.

25 more cards in the app

Study this set free