C language has different character sets and symbols. There are many special characters with special meaning. Operators are special symbols which cause to perform mathematical or logical operations. Following are the symbols used for arithmetic operators in C.
Operators

Meaning

+

Addition



Subtraction

*

Multiplication

/

Division

%

Remainder

a + b = a a and b operands + operator
 a + b + takes two operands 'a" and 'b'. So it is binary operator
 b i takes one operand. So it is unary operator
Different types of operators available in C are
Arithmetic Operators
It is the basic and common operation in a computer programming language and used to perform mathematical operations. It is known as binary operator since they take two operands to be evaluated.
Operators

Meaning

Example

+

Addition

X+y



Subtraction

xy

*

Multiplication

X*y

/

Division

x/y

%

Remainder

X%y (returns reminder)

Assignment Operators
The assignment operator is used to assing a value to a variable. The form is as follows
variable = expression;
When executed, expression is evaluated, and the resulting value is assigned to variable,
Some assignment operators are
Operators

Example

+=

x+=y, x=x+y, x+y is equal to x=x+y;

=

x=y

*=

X*=y

/=

x/=y

%=

X%=y

Unary Operators
The unary mathematical operators are so named because they take a single operand. Unary operator acts upon single operand to be increased or decreased by one.
Operators

Symbol

Action

Example

Increment

++

Increment the operand by one

++x, x++

Decrement



Decrements the operand by one

x, x

++x; y;are the equivalent of these statements:
x=x+1; y=y1;They differ in terms of when the increment or decrements is performed;
 When used in prefix mode, the increment and decrements operators modify their operand before it's used.
 When used in postfix mode, the increment and decrements operators modify their operand after it's used.
x=10; y=x++;after these statements are executed, x has the value 11, and y has the value 10. The value of x was assigned to y, and then x was incremented. In contrast, the following statements result in both y and x having the value 11. x is incremented, and then its value is assigned to y. an example of postfix mode;
x=10; y= ++x;
Relational Operators
Relational operators are used to compare expression , asking questions such as "is x greater than 50?" or "is y is equal to 0?" an expression containing a relational operator evaluates to either true (1) or false (0).
Operators

Symbol

Example

Equal

==

x ==y

Greater than

>

x>y

Less than

<

x<y

Greater than or equal to

>=

x>=y

Less than or equal to

<=

x<=y

Not equal

!=

x!=y

Logical Operators
Logical operators let you combine two or more relational expression into a single expression that evaluates to either true or false.
Operators

Symbol

Example

AND

&&

Expression1 && Expression2

OR



Expression1  Expression2

NOT

!

!expression1

Ternary Operator
The ternary operator is C's only ternary operator, meaning that it takes three operands,
expression1? expression2 : expression3;
x=y?1:100;Likewise, to make z equal to the larger of x and y, you could write
z=(x>y)?x:y;
if(x>y) z=x; else z=y;The ternary operator can't be used in all situations in place of an if...else construction, but the conditional operators is more concise. The ternary operator can also be used in places you can't use an if statement,such as inside a single printf() statement.
printf("The larger value is %d",((x>y)?x:y));
Comma Operator
It permits two different expression to appear in situation where only one expression would ordinarily be used.
{ int a,b,c; c=(a=10, b=20, a+b); printf("C=%d",c); }
Sizeof Operator
This is a unary operator, which finds out the number of bytes that any object occupies in computers' memory. It has the same precedence and associativity as the other unary operators. The syntax for sizeof operator is,
sizeof(object);
where object refers to variable or data type. for example, the size of data types can be displayed by the following statements.
printf("size of char = %u bytes", sizeof(char)); printf("size of int = %u bytes",sizeof(int)); printf("size of float = %u bytes",sizeof(float)); printf("size of double = %u bytes",sizeof(double));
Similarly, the type of a constant or a variable can be displayed as,
printf("size of char = %u bytes",sizeof(a)); printf("size of int = %u bytes",sizeof(5));
Conditional Operator
The conditional operator in C is also known as ternary operator ?:. It is called ternary operator because it takes three arguments. The conditional operator has the following construct.expr1 ? expr2 : expr3
small = x<y ? x : y;small is assigned the value of x if x is smaller than y otherwise y is assigned to small. This expression is equivalent to the following ifelse statement.
if(x<y) small = x; else small = y;
C Code
#include<stdio.h> #include<conio.h> void main() { int a = 5, b = 8; int c; c = (a < b)? a : b; printf(“%d”, c); }