1 / 6

C Operators Tutorial

There are various operators in the c programming language, if you know about the basics of c language and want to know more about c programming then visit here our c operator tutorial. For further more information visit here<br>https://www.phptpoint.com/c-programming-language-tutorial/

Phptpoint
Download Presentation

C Operators Tutorial

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. C Operators C language includes a rich set of integrated operators. An operator is a symbol used to perform a certain application of mathematics or logic. Operators are used in ​C programming language to manipulate the data and variables in applications and are part of mathematical or logical expressions. In other terms, we may say the operands are handled by an operator. There are major types of operators in C: ● Arithmetic Operators ● Relational Operators ● Logical Operators ● Bitwise Operators ● Assignment Operators ● Conditional Operators

  2. These are operators, we know in this​​c tutorial 1. Arithmetic operators Both simple arithmetic operators are provided by C. The table below shows all of the essential arithmetic operators.   Operator Description + adds two operands - subtract second operands from first * multiply two operand / divide numerator by the denominator % remainder of division ++ Increment operator - increases integer value by one -- Decrement operator - decreases integer value by one

  3.   2. Relational operators   The table below lists all C assisted Partnership Operators. Operator Description == Check if two operands are equal != Check if two operands are not equal. > Check if the operand on the left is greater than operand on the right < Check operand on the left is smaller than the right operand >= check left operand is greater than or equal to the right operand <= Check if the operand on left is smaller than or equal to the right operand   3.Logical operators C language supports 3 logical operators. Assume a = 1 and b = 0,  

  4. Operator Description Example && Logical AND (a && b) is false || Logical OR (a || b) is true ! Logical NOT (!a) is false   4.Bitwise operators Bitwise operators perform Bit Level Data Manipulation. Such operators also do bits change from right to left. Bitwise operators are not used for floating or duplicating.   Operator Description & Bitwise AND | Bitwise OR ^ Bitwise exclusive OR

  5. << left shift >> right shift 5. Assignment Operators   Operator Description Example   = a=b Assigns values from right operand  ​to left-hand += Attach right operand to left operand and assign a+=b is same as a=a+b the result to left operand -= Subtracts operand right from operand left and a-=b is same as a=a-b assigns the output to operand left *= Multiply the left operand and assign the output to a*=b is same as a=a*b the left operand /= Divide left operand with right operand and assign a/=b is same as a=a/b left operand to the result

  6. Calculate the modulus using two     operands and     operand result            %= a%=b is same as a=a%b assign the   left   Conditional Operators   The C-language conditional operators are identified by two more names   1. Ternary Operator 2. ?: Operator   It is basically the if condition that we use in C language decision-taking, but we transform the if condition expression into a short and easy operator with conditional operators. The syntax of a conditional operator is ​: expression ​1​? expression ​2​: expression ​3 Original source 

More Related