Skip to main content

Posts

Showing posts with the label Operators in C Language
To Get All Information of Sarkari Jobs | Results | Admit Card | And courses ,Internships then CLICK HERE

Bit-wise Operator-:

C has the special feature to manipulate with bits,in some application we require manipulation on bits such as system programming. C has bit-wise operator to support bit-wise operation ,possible bit-wise operator available in C are as follow-: (a-) Once Complement -: This operator is denoted as  " ~ " [tilde] . This operator is unary in nature, i.e. it require single operand to perform an operation.It is one of the method used for data encryption. It works on binary pattern and convert all the one's into zero and zero's into one. Example -: consider the following bit pattern:-                       110101001 Hence,its once complement will be 001010110. (b-) Bit-wise Left Shift -: This operator is denoted as " << " . This operator is binary in nature,i.e. it require two operands to perform an operation.The left operand is variable and right operand is in binary pattern,the bits are shifted to left and for each bit...

Increment and Decrement Operator-:

  Increment and Decrement Operator  are unary in nature i.e. it require single operand to perform an operation.Increment operator is represented by "++" while decrement operator is represented by "--".     I ncrement -:   Pre increment     [ ++i ]                         Post increment     [ i++ ]   Decrement -:   Pre decrement      [ -- i ]                         Post decrement      [ i -- ] Increment operator increments the value of operands by 1 while decrement operator decrements the value of an operands by 1.                                                                ...

Conditional Operator/ Special Operator-:

Conditional Operator/ Special Operator  is ternary in nature i.e. it require three operands to   perform an operation.It is denoted by  " ? : "   The execution  of conditional operator is as follow-:       (a-) The first operand is converted to "bool" and then it is evaluated.       (b-) If the first operands evaluate to TRUE[1], the first expression will execute.       (c-) If the first operands evaluate to FALSE[0], then second expression will execute. Syntax -:     condition?expression 1 : expression 2; Example -:                       int x,y;                      printf("enter value of y");                      scanf("%d",y);                   ...

Compound Assignment Operator-:

  Compound Assignment Operator  is the combination of arithmetic operator and assignment operator.The possible compound assignment operator are as follow-: (a-)  + =            =>  a+=b;   this statement equals to a=a+b. (b-)   -  = =>  a-=b;     this statement equals to a=a-b.   (c-)  *  = => a*=b;    this statement equals to a=a*b. (d-)   /  =  => a/=b;     this statement equals to a=a/b. (e-)   % = => a%=b;    this statement equals to a=a%b.   Example -: 7+=2   => 7+2=9 8-=4    => 8-4=4 3*=2   =>  3*2=6 5/=2    => 5/2=2 16%=3 => 16%3=1 ads Watch The Video Below

Assignment Operator:-

Assignment Operator   is used to assign the value of right operand to left operand,it is denoted by  "=".  When an assignment operator encounter in an expression the compiler process expression on right hand side of the assignment operator and then assign the result to the variable on left hand side.It is  Binary  in nature.   Possibilities for an assignment operator are as follow:-   Examples -:               (a-)  variable=constant                              x=a;            (b-)  variable=variable                               x=y;            (c-)   variable=expression                      ...

Logical Operator-:

  Logical Operator   are those operator which are used to combine two or more than two condition to form a single larger compound condition,possible logical operator are-: Logical AND- && Logical OR-  | | Logical NOT- !    The  precedence  of logical operator are as follow-:                  [ ! ]- I                 [ && ]- II                 [  | | ]- III Truth Table -:                           Logical AND and Logical OR are also known as  Short ciruit operator. Example -:         [(a>b)&&(a<c)]  The above expression has two condition join by using Logical AND. So,if the first condi...

Relational Operator-:

Relational Operator  are those operator which are used to form a condition by establishing a relation between two operands.Expression that contain relational operator are called as relational expression.They give result either  TRUE [1]  or  FALSE [0] .All  relational  operator have  same Precedence.  All relational operator are  binary  in nature. Possible relational operator are follow-:                                                  ads <  Less than >  Greater than <= Less than or equals to >= Greater than or equal to == Equal to != Not Equal to Example -:  Suppose  x=15   and  y=12                                       x<y...

Arithmetic Operators-:

Arithmetic Operator are those operator which are used to perform arithmetic operation, possible arithmetic operato r are   +, - , / , * ,% .  Precedence  of arithmetic operator are as follow-:                                                  * , / ,%  -:  I                             + -: II                             -  -: III  The  Division  operator  [/], gives  quotient  while  Modulus  operator  [%]  gives  remainder. Example -:  5*2=10   16/3=5   18%4=2 42+8=50 77-2=75 All  arithmetic  operator are  binary  in nature.All operator may applied on integer as well as floating point val...

Operators in C Language-:

Operator are the symbols which are used to perform operations they are mathematical ,logical , relational on operand or variable .C programming language has wide range of operator to perform various operation .The operators are either  Unary , Binary  and ternary in nature. Unary operator require a single operand to perform an operation. Binary operator require two operands to perform operation. Ternary operator require three operands to perform operation. Each and every operator available in C language have its own Precedence and Associativity. If in a expression there are more than one operators then,we will firstly solve operator which is having higher Precedence. Associativity defines the operational behaviour of the operator,either right associative or left associative.  Below are the operators available in C language -: Arithmetic Operator    Click here Relational Operator    Click here     ...

Download The Book "Let Us C" By Yashavant P.Kanetkar,Click The Below Button

-->Email Subscription

Enter Your Email Address:-

Delivered by FeedBurner

Copyright © 2020 TechProgramiz|All Right Reserved|Made By-: Sudarshan Pandey