operators and expressions in c

operators and expressions in c language

The sign that are used to complete  logical & mathematical operations in c programs are called operators.consider the expression A+B*10 inside +,*. are operators, A,B are  variables, and 10 is constant. and A+B*10 is an expression.There are different types of operators in c which are below.

Types of operators

There are different types of operators in c language which are as follows.

  • Arithmetic operators
  • relational operators
  • special operators
  • Bit-wise operators
  • assignment operators
  • increment  or decrements operators
  • logical operators
  • conditional operators

Arithmetic operators

An arithmetic operator is a mathematical  function that takes two operands and performs a calculation on them for taking the result. Arithmetic operators  are used in common and most computer languages contain a set of  operators that can be used within the equations to execute  a number of types of sequential calculation.


 
 
 
 
Relational operators

A relational operator comparison  the  two values  quantitatively. Using  the Relational Operator segment In C Programming we can compare the value stored between two variables and depending on the result we can follow different blocks using Relational Operator in C language.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Special operators

The special  operator is a symbol that tells the compiler to perform specific mathematical or logical operations. in c some special operators are as follows.

Bit-wise operators

The bit wise  operator is used to perform bit wise tasks on bit patterns.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Assignment operator
The assignment operator  is operator  used to give  the  new value to a variable,Assignment operators can also be used for the  logical operations such as bit wise logical operation.

increment/decrements operators

The increment   operators is  unary operators that add or subtract one represented by (++) sign. The increment operator is used to increase the value by one,on the other side the Decrements operator is used to decrease the  value of the  variable by  one  (1)the decrements operator is denoted by –.

logical operators

The idea  of the  logical operators is very  simple. They permission  the  program to make a decision based on multiple conditions either true or false . Every  operand is considered a condition that can be evaluated to a true or false values.There are three types of  logical operators in c these are   (OR), && (AND), ! (NOT)  they are called.

 

conditional operators

The  Conditional operators return one value if the condition is true and returns false if the condition is false.There are three conditional operators in c these operators  tells the compiler to perform specific mathematical  functions. C language is rich in built-in operators and provides the following types of operators − Arithmetic Operators. Relational Operators. Logical Operators.
 

Hits: 5

Leave a Reply

Your email address will not be published. Required fields are marked *