PST-pdf Instagram Twitter YouTube
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
--------------------------------------------------------------------------------------------------------------------
1. INTRODUCTION PST-PDF
-------------------------------------------------------------------------------------------------------------------
2. OPERATORS
-------------------------------------------------------------------------------------------------------------------
2.1 Arthmetic
C supports all the basic arithmetic operators. The following table shows all the basic arithmetic operators.
Operator Description
+ adds two operands
- subtract two operands
* multiply two operands
/ divide two operands
% remainder of division
++ increases integer value by one
-- decreases integer value by one
For Programming Training:
DM me Instagram
-----------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------
2.2 Assignment
Assignment operators supported by C language are as follows.
Operator Description Example
=
assigns values from right side operands to left side operand
a=b
+=
adds right operand to the left operand and assign the result to left
a+=b is same as a=a+b
-=
subtracts right operand from the left operand and assign the result to left operand
a-=b is same as a=a-b
*=
mutiply left operand with the right operand and assign the result to left operand
a*=b is same as a=a*b
/=
divides left operand with the right operand and assign the result to left operand
a/=b is same as a=a/b
%=
calculate modulus using two operands and assign the result to left operand
a%=b is same as a=a%b
For Programming Training:
DM me Instagram
--------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------
2.3 Bitwise




Operator Description
& Bitwise AND
| Bitwise OR
^ Bitwise exclusive OR
<< left shift
>> right shift
For Programming Training:
DM me Instagram
-------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------
2.4 Conditional
Conditional operator The Conditional Operators in C language are known by two more names.
Ternary Operator
? : ;
It is actually the if condition that we use in C language decision making, but using conditional operator, we turn the if condition statement into a short and simple operator.
Syntax:
expression 1 ? expression 2: expression 3;
Explanation:




For Programming Training:
DM me Instagram
---------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------
2.5 Logical
C language supports following 3 logical operators. Suppose a = 1 and b = 0,
Operator Description Example
&& Logical AND (a && b) is false
|| Logical OR (a || b) is true
! Logical NOT (!a) is false
For Programming Training:
DM me Instagram
-------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------
2.6 Relational
The following table shows all relation operators supported by C.
Operator Description
== Check if two operand are equal
!= Check if two operand are not equal.
> Check if operand on the left is greater than operand on the right
< Check operand on the left is smaller than right operand
>= check left operand is greater than or equal to right operand
Thanks a lot. |
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
BCA PST & Programming C Allrounder Sita Ram Sahu
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
>
No comments:
Post a Comment