Operators and Expressions in C Language

  • The symbols which are used to perform logical and mathematical operations in a C program are called C operators.
  • These C operators join individual constants and variables to form expressions.
  • Operators, functions, constants and variables are combined together to form expressions.
  • Consider the expression A + B * 5. where, +, * are operators, A, B  are variables, 5 is constant and A + B * 5 is an expression.

Types of operators in C language:

C language offers many types of operators. They are,
    1. Arithmetic operators
    2. Assignment operators
    3. Relational operators
    4. Logical operators
    5. Bit wise operators
    6. Conditional operators (ternary operators)
    7. Increment/decrement operators
    8. Special operators

 Continue on types of C language operators:

Types of Operators
Arithmetic_operatorsThese are used to perform mathematical calculations like addition, subtraction, multiplication, division and modulus
Assignment_operatorsThese are used to assign the values for the variables in C programs.
Relational operatorsThese operators are used to compare the value of two variables.
Logical operatorsThese operators are used to perform logical operations on the given two variables.
Bit wise operatorsThese operators are used to perform bit operations on given two variables.
Conditional (ternary) operatorsConditional operators return one value if condition is true and returns another value is condition is false.
Increment/decrement operatorsThese operators are used to either increase or decrease the value of the variable by one.
Special operators&, *, sizeof( ) and ternary operators.

www.cinterviews.com appreciates your contribution please mail us the questions you have to cinterviews.blogspot.com@gmail.com so that it will be useful to our job search community

No comments: