stagetuta.blogg.se

C++ programs list
C++ programs list









Here, operators with the highest precedence appear at the top of the table, those with the lowest appear at the bottom. Certain operators have higher precedence than others for example, the multiplication operator has a higher precedence than the addition operator.įor example, x = 7 + 3 * 2 here, x is assigned 13, not 20 because operator * has a higher precedence than +, so it first gets multiplied with 3*2 and then adds into 7. Operator precedence determines the grouping of terms in an expression and decides how an expression is evaluated.

c++ programs list

If Condition is true ? then value X : otherwise value Y

c++ programs list

&a returns the actual address of the variable. Sizeof(a), where a is integer, will return 4. It takes modulus using two operands and assigns the result to the left operand.īitwise exclusive OR and assignment operator.īitwise inclusive OR and assignment operator.īesides the operators discussed above, there are a few other important operators including sizeof and ? : supported by the C Language. It divides the left operand with the right operand and assigns the result to the left operand. It multiplies the right operand with the left operand and assigns the result to the left operand.ĭivide AND assignment operator. It subtracts the right operand from the left operand and assigns the result to the left operand. It adds the right operand to the left operand and assign the result to the left operand. Assigns values from right side operands to left side operandĬ = A + B will assign the value of A + B to CĪdd AND assignment operator. The following table lists the assignment operators supported by the C language − The left operands value is moved right by the number of bits specified by the right operand. If yes, then the condition becomes true.īinary Right Shift Operator. If yes, then the condition becomes true.Ĭhecks if the value of left operand is greater than or equal to the value of right operand. If the values are not equal, then the condition becomes true.Ĭhecks if the value of left operand is greater than the value of right operand. If yes, then the condition becomes true.Ĭhecks if the values of two operands are equal or not. Assume variable A holds 10 and variable B holds 20 then −Ĭhecks if the values of two operands are equal or not. The following table shows all the relational operators supported by C. Increment operator increases the integer value by one.ĭecrement operator decreases the integer value by one. Modulus Operator and remainder of after an integer division. Assume variable A holds 10 and variable B holds 20 then − The following table shows all the arithmetic operators supported by the C language. We will, in this chapter, look into the way each operator works. C language is rich in built-in operators and provides the following types of operators − An operator is a symbol that tells the compiler to perform specific mathematical or logical functions.











C++ programs list