- Keywords
- Identifiers
- Constants
- Strings
- Operators
- Special characters
|
auto |
double |
int |
struct |
|
break |
else |
long |
switch |
|
case |
enum |
register |
typedef |
|
char |
extern |
return |
union |
|
const |
short |
float |
unsigned |
|
continue |
for |
signed |
void |
|
default |
goto |
sizeof |
volatile |
|
do |
if |
static |
while |
Rules for Naming Identifiers :
- An identifier can only have alphanumeric characters (a-z, A-Z, 0-9) (i.e. letters & digits) and underscore( _ ) symbol.
- Identifier names must be unique.
- The first character must be an alphabet or underscore.
- You cannot use a keyword as identifiers.
- Only first thirty-one (31) characters are significant.
- Must not contain white spaces.
- Identifiers are case-sensitive.
c
|
s
|
t
|
r
|
i
|
n
|
g
|
\0
|
- Arithmetic Operators
- Relational Operators
- Logical Operators
- Assignment Operators
- Increment and Decrement Operators
- Conditional Operator
- Bitwise Operators
- Special Operators
|
Operator |
Description |
|
+ |
Addition |
|
- |
Subtraction |
|
* |
Multiplication |
|
/ |
Division |
|
% |
Modulus |
Increment and Decrement Operators : Increment operator ++ increases the value by 1 whereas decrement operator -- decreases the value by 1.
|
Operator |
Description |
|
++ |
Increment |
|
−− |
Decrement |
Relational Operators : Relational operators are used to comparing two quantities or values.
|
Operator |
Description |
|
== |
Is equal to |
|
!= |
Is not equal to |
|
> |
Greater than |
|
< |
Less than |
|
>= |
Greater than or equal to |
|
<= |
Less than or equal to |
Logical Operators : C provides three logical operators when we test more than one condition to make decisions.
|
Operator |
Description |
|
&& |
And operator. It
performs logical conjunction of two expressions. (if both expressions
evaluate to True, result is True. If either expression evaluates to False,
the result is False). |
|
|| |
Or operator. It
performs a logical disjunction on two expressions. (if either or both
expressions evaluate to True, the result is True). |
|
! |
Not operator.
It performs logical negation on an expression. |
Bitwise Operators : C provides a special operator for bit operation between two variables.
|
Operator |
Description |
|
<< |
Binary Left Shift Operator |
|
>> |
Binary Right Shift Operator |
|
~ |
Binary Ones Complement Operator |
|
& |
Binary AND Operator |
|
^ |
Binary XOR Operator |
|
| |
Binary OR Operator |
Assignment Operators : Assignment operators applied to assign the result of an expression to a variable.
|
Operator |
Description |
|
= |
Assign |
|
+= |
Increments
then assign |
|
-= |
Decrements
then assign |
|
*= |
Multiplies
then assign |
|
/= |
Divides
then assign |
|
%= |
Modulus
then assign |
|
<<= |
Left
shift and assign |
|
>>= |
Right
shift and assign |
|
&= |
Bitwise
AND assign |
|
^= |
Bitwise
exclusive OR and assign |
|
|= |
Bitwise
inclusive OR and assign |
Operator
|
Description
|
? :
|
Conditional Expression
|
Special Operators : C supports some special operators
|
Operator |
Description |
|
sizeof() |
Returns the size of a memory location. |
|
& |
Returns the address of a memory location. |
|
* |
Pointer to a variable. |
Special Characters : There are some Special Characters in C Programming, which are as shown in the table.
,
|
<
|
>
|
.
|
_
|
(
|
)
|
;
|
$
|
:
|
%
|
[
|
]
|
#
|
?
|
‘
|
&
|
{
|
}
|
“
|
^
|
!
|
*
|
/
|
|
|
-
|
\
|
~
|
+
|
No comments:
Post a Comment