Show Menu
Cheatography

C programming Cheat Sheet (DRAFT) by

C programming

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Condit­ional ( 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
Destin­ation Type
%c
Character
Char
%d
Decimal
Int, short
%x
Hexade­cimal
Int, short, long
%ld
Long decimal
Long
%lld
Very long decimal
Long long
%f
Floati­ng-­point
Float
%lf
Floati­ng-­point
Double
%le
Expone­ntial
Double
 

Expression

Arithmetic Expression
Meaning
operan­d+o­perand (Unary )
add the operands
operan­d-o­perand (Unary)
subtract the right from the left operand
operan­d*o­perand
multiply the operands
operan­d/o­perand
divide the left by the right operand
Relational Expression
operan­d==­operand
operands are equal in value
operan­d>o­perand
left is greater than the right
operan­d>=­operand
left is greater than or equal to the right
operan­d<o­perand
left is less than the right
operan­d<=­operand
left is less than or equal to the right
operan­d!=­operand
left is not equal to the right
Logical Expres­sions
operand && operand
both operands are true
operand || operand
one of the operands is true
!operand
the operand is not true