Any individual item or combination of items, like variables, literals, operators, and parentheses, that evaluates to a value.
Expression
The C language will always pair an "else" statement with the last if statement not isolated using braces.
The Dangling Else Problem
"Seeds" the random number generation. Seed determines what random numbers are generated during runtime of the program.
srand()
int x = 1/2 * 3 * 5;
x = 0
There is only one case when the outcome is true and that is when both operators are in a true condition.
Used to clamp the range of values to be generated by rand()
Modulo (%)
int m = 10;
int n = --m * m--;
m = 8
n = 81
Code equivalent of testing if x is between 30 and 50 (inclusive).
if(x >= 30 && x <= 50)
Name of the macro that defines the biggest value rand() can return
RAND_MAX
Data truncation is a consequence of this idea.
Type Demotion
Use when your conditions involve a single variable being compared to a finite set of constant, discrete values.
switch statement
rand() % 298
The only arithmetic operator that doesn't automatically work with floats/doubles
Modulo (%)
int a = 3
switch(a)
{
case 1:
printf("1");
break;
case 3:
printf("2");
default:
printf("default");
break;
case 2:
printf("3");
}
2default
Generates random numbers between -50 and 50.
(rand() % 101) - 50;