C programming
Operator:
An operator is a symbol that specifies the mathematical, logical or realation operation to be performed. C language supports different type off operators which is used with the variables.
Operators in C:
- Arithmetic
- Relational
- Equality
- Logical
- Unary
- Conditional
- Bitwise
- Assignment
- Comma
- Size of operator
Arithmetic operator:
Arithmetic operators take numerical values (either literals or variables) as their operands and return a single numerical value. The standard arithmetic operators are addition (+), subtraction (-), multiplication (*), and division (/).
Relational operator:
Relational operator is also known as comparison operator. This operator compares two values. Relational operator returns a true or false value.
Ex.- < , >, <= , >= .
Equality Operator:
C language supports two kind of equality operators.
- equal ( = )
- not equal (! = )
Comparison Operators:
- Greater than (>)
- equal to (==)
- Less than (<)
- Greater than or equal than to (>=)
- Less than or equal to (<=)
Logical operator:
C language supports three logical operator -- logical AND( && ) ,logical OR (::) ,logical NOT ( ! ).
Logical AND:
Input output
X Y Z
0 0 0
0 1 0
1 0 0
1 1 1
Logical OR:
Input output
X Y Z
0 0 0
0 1 1
1 0 1
1 1 1
Logical NOT:
p 0 1
~p 1 0
Unary operator:
Unary operator act on single operands.C languaeg supports three unary operators : unary minus , increment and decrement operator.
Conditional operator:
In conditional operator only one sign ( ?: )this is use in situation place.
Assignment operator:
in C this is use or assign any value in variable. and sign is ( = )
here value assign from right variable to left variable, left side variable store that value.
ex- a=b
here value of b will store in a.and b will be empty.
Thank you,
now here intro of C language is complete these are some basic information of C, and after remember you will continue your C.
If i forget anything or you want more explain on any point please comment below.
Comments
Post a Comment