202 Flashcards
What is the main function?
This is where the program begins execution
How can you comment a C file?
// TEXT or /* TEXT */
What is a short?
A type of integer
Shorter than a normal integer
16 bits
Can be signed and unsigned
What is an int?
A normal integer
32 bits
Can be signed and unsigned
What is a long?
A type of integer.
Longer than a normal integer
64 bits
Can be signed or unsigned
What is a char?
A character variable
8 bits
Can be signed or unsigned
What is a string?
Multiple characters one after the other.
What is a float?
A floating point variable. A number with decimal places.
Single precision
32 bits
7 decimal places
What is a double?
A floating point variable. A number with decimal places.
double precision
64 bits
16 decimal places
What is a global variable?
Can be accessed by all parts of code.
What is a local variable?
Can be accessed by only certain sections of code
What is a literal?
This is when there is a number in the code that is not stored in a variable.
Specified in: Decimal, binary, hexadecimal and scientific notion
What the arithmetic operators? What do they do?
Mathematical operations on binary \+ Addition - Subtraction * Multiplication / Division % Modulo (Finds the remainder) \++ Increments the variable by 1 -- Decrements the variable by 1
What is the notation for ++ and –?
b = 5;
b++;
b–;
IT IS NOT:
c = b++;
What is a relational operator? What are they?
Compares two variables and outputs a boolean: > Greater than < Less than == Equivalent != Not equivalent >= Greater than or equal to <= Less than or equal to