This is a draft cheat sheet. It is a work in progress and is not finished yet.
Conditional ( Branching)
Arithmetic types
Type |
Bytes |
Suffix |
Char |
1 Byte |
short |
2 Bytes |
Long |
4 Bytes |
L or l |
Long long |
8 Bytes |
LL or ll |
Int |
4 Bytes |
Float |
4 Bytes |
F or f |
Double |
8 Bytes |
|
|
Input Format
Specifier |
Input Text is a |
Destination Type |
%c |
Character |
Char |
%d |
Decimal |
Int, short |
%x |
Hexadecimal |
Int, short, long |
%ld |
Long decimal |
Long |
%lld |
Very long decimal |
Long long |
%f |
Floating-point |
Float |
%lf |
Floating-point |
Double |
%le |
Exponential |
Double |
|
|
Expression
Arithmetic Expression |
Meaning |
operand+operand (Unary ) |
add the operands |
operand-operand (Unary) |
subtract the right from the left operand |
operand*operand |
multiply the operands |
operand/operand |
divide the left by the right operand |
Relational Expression |
operand==operand |
operands are equal in value |
operand>operand |
left is greater than the right |
operand>=operand |
left is greater than or equal to the right |
operand<operand |
left is less than the right |
operand<=operand |
left is less than or equal to the right |
operand!=operand |
left is not equal to the right |
Logical Expressions |
operand && operand |
both operands are true |
operand || operand |
one of the operands is true |
!operand |
the operand is not true |
|