Skip to content

Latest commit

 

History

History
117 lines (82 loc) · 1.74 KB

File metadata and controls

117 lines (82 loc) · 1.74 KB
  1. Start from the top of a function (from top to bottom)

  2. Use a standard function (eg. )

  3. : - start of main function | - end of main function

  4. < > - body

  5. $ - comments

  6. Data Types -

    a. Basic - int, float, char, double, bool, String b. Derived - array, pointer, structure

  7. Variables -

    Declaration - eg. number=10

  8. Operators -

    a. Arithmetic - + addition or unary plus - subtraction or unary minus * multiplication / division % modulo division
    ++ increment -- decrement

    b. 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()

  9. if...else statement - agar condition< //code to be executed if condition is true

    magar condition<
    //code to be executed if condition is FALSE

  10. Loops - for loop - kliye(initialization;condition;incr/decr)< //code to be executed >

    while loop - jabtak(condition)< //code to be executed >

  11. break -

    //loop or switch case
    break;

  12. continue -

    //loop statements
    continue;
    //some lines of the code which is to be skipped

  13. Input - de()

    Output - le()

  14. Function declaration:

    return_type name(arguments)< //code to be executed

  15. Arrays - data_type array_name[array_size];

  16. type casting -

    (type)value;