-
Start from the top of a function (from top to bottom)
-
Use a standard function (eg. )
-
: - start of main function | - end of main function
-
< > - body
-
$ - comments
-
Data Types -
a. Basic - int, float, char, double, bool, String b. Derived - array, pointer, structure
-
Variables -
Declaration - eg. number=10
-
Operators -
a. Arithmetic - + addition or unary plus - subtraction or unary minus * multiplication / division % modulo division
++ increment -- decrementb. Assignment - = a = b a = b += a += b a = a+b -= a -= b a = a-b *= a = b a = ab /= a /= b a = a/b %= a %= b a = a%b
c. Relational - == Equal to GT Greater than LT Less than != Not equal to >= Greater than or equal to <= Less than or equal to
d. Logical - Logical AND Logical OR Logical NOT
e. Bitwise - & Bitwise AND | Bitwise OR ^ Bitwise exclusive OR ~ Bitwise complement << Shift left >> Shift right
f. Comma operator - ,
g. sizeof operator(returns size of variable) - sizeof()
-
if...else statement - agar condition< //code to be executed if condition is true
magar condition<
//code to be executed if condition is FALSE -
Loops - for loop - kliye(initialization;condition;incr/decr)< //code to be executed >
while loop - jabtak(condition)< //code to be executed >
-
break -
//loop or switch case
break; -
continue -
//loop statements
continue;
//some lines of the code which is to be skipped -
Input - de()
Output - le()
-
Function declaration:
return_type name(arguments)< //code to be executed
-
Arrays - data_type array_name[array_size];
-
type casting -
(type)value;