Operators

What is Conditional & ternary operators In C Programming Language?

The conditional operator? and: are sometimes called ternary operators. A ternary operator is one which contains three operands. The general form of ternary operator is: exp 1 ? exp 2 : exp 3 The operator works as, if exp 1 is evaluated first. If the result is true then exp 2 is executed, otherwise exp 3 is executed. A program of ternary operator: …

What is Conditional & ternary operators In C Programming Language? Read More »

What is Assignment operator In C Programming Language?

Assignment operators are used to assign the result of an expression to a variable. The most commonly used assignment operator is (=). eg:      i=i+10;       i=i+10 is an assignment expression which assigns the value of i+10 to i. Expression like   i=i+10,  i=i-5,  i=i*2 etc. can be rewritten using shorthand assignment operators. e.g.:   i=i+5 is equivalent to i+=5             i=i*(y+1)  is equivalent to   i*=(y+1) Operator …

What is Assignment operator In C Programming Language? Read More »