0% found this document useful (0 votes)
66 views21 pages

C Introduction New

The document provides an introduction to programming languages and C programming language. It discusses that a programming language allows humans to communicate with computers through a set of instructions. It then categorizes programming languages as low-level, middle-level, and high-level. C is introduced as a general purpose, procedural programming language that is portable, structured, and has a rich library of functions. The document outlines the basic components of a C program including variables, constants, and data types.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views21 pages

C Introduction New

The document provides an introduction to programming languages and C programming language. It discusses that a programming language allows humans to communicate with computers through a set of instructions. It then categorizes programming languages as low-level, middle-level, and high-level. C is introduced as a general purpose, procedural programming language that is portable, structured, and has a rich library of functions. The document outlines the basic components of a C program including variables, constants, and data types.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Jyoti Chandnani

C Programming

Introduction to Programming Language


In daily life, to communicate with people around us, we need a language so that they
can understand what we are communicating to them. Language is a way we use to
share ideas, opinions to others.
In the same way, for a human to communicate with the computer, we need a special
kind of language called programming language. It is called programming language
because human write programs to communicate with computer.
Program -> It is set of instructions that are written in any programming language to
perform specific task by the computer.
Types of Programming Language:
1) Low level programming Language
2) Middle level programming language
3) High level programming language

a) Low Level Programming Language : Two types of low-level language :

1)Machine-level language : It is a language in which programs are written in the


form of binary code (i.e. 0’s and 1’s). As the binary code is understandable by
machine, programs executes very fast.
Creating a program in machine language is very difficult as instructions are in 0
and 1 form, so it is error prone. Debugging (finding error) in machine lang.
program is also difficult. Machine language is not portable means program written
for one machine will not be valid for another machine as each computer has its
own machine instructions.

2) Assembly level language: The programs in assembly level language contains


English-like instructions like mul, add ,mov etc. The programs are easy to write,
understand and debug as compare to machine lang. programs. As machine
cannot understand instructions of assembly lang. programs, a translator called
assembler is required which will convert assembly lang. program into machine
lang. program.
The disadvantage of assembly language is that programmer has to keep track of
what data resides in which registers. That is why assembly lang. is also not
portable.

b) High Level Language: The programs in high level language are like human
language. For eg, instead of writing “add” instruction as in assembly lang.
program, in high level , we directly use ‘+’ symbol. Another advantage is
Jyoti Chandnani

programmer don’t have to keep track of register content. The programs in high
level lang. are easier to write, understand and debug. As machine cannot
understand the programs written in high level language, we need a translator
called compiler to translate the programs in high level lang to machine
language.

c) Middle level language: It lies between the low level and high level
programming language .It is user friendly and closely related to machine
language.

C Programming Language Introduction:


- C is a programming developed by Dennis Ritchie at AT&T ‘s lab located at USA
in 1972.
- It was mainly developed as a system programming language to develop
system software like operating systems, drivers, word processors etc.
- C is base language for many other programming languages as many languages
use the same syntax as c language. Hence, C is also called mother
programming language.
Features of C Language
C has now become widely used professional language because it has following
features:
1) Simple: The syntax f of C is simple and easy to learn and understand.
2) Machine Independent or Portable: C programs can be written in one machine
and can be executed in another machine without modifying any code. So it is
machine independent and portable.
3) Structured Programming Language: C is called structure modular
programming language because it divides the large and complex problems
into smaller programs in the form of a blocks or a function. Each smaller part
can be implemented using function (procedure). Hence, C is also called
procedural programming language.
4) General purpose language: C is called general purpose programming language
because it is used to design all types of software from system software like
operating system, device drivers etc to application software like photo editing
software.
5) Middle level language: C has capabilities of assembly level language and
features of high level language. Hence, it is middle level language
6) Rich library: Many in-built functions like avg() are provided by C which makes
coding easier. We can get the functionality of in-built functions by just
including header files in the program
7) Extensible: It is easy to add new features in the c. Hence, Extensible.
Jyoti Chandnani

Getting started with C language


To communicate with computer means speaking with computer.
Steps for learning any language

Steps for learning C

C Character Set
A character denotes any alphabet, digit or special symbol used to represent
information. Following are the valid alphabets, numbers and special symbols allowed
in C.
• Alphabets - A, B, ….., Y, Z a, b, ……, y, z
• Digits - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
• Special symbols - ~ ‘ ! @ # % ^ & * ( ) _ - + = | \ { }
[]:;"'<>,.?/
Constants
Constant is a value that doesn’t change.
Types of Constants
1. Integer Constants
2. Character Constants
3. Float Constants
4. String Constants
5. Symbolic Constants

1. Integer Constant
Rules :
1. At one digit should be there.
2. It cannot have decimal number.
3. It can be positive or negative.
4. by default its positive number.
5. -32767 to +32767 and -2147483648 to +2147483648(depending on compiler)
Eg. 12,5,6,32,-78
Jyoti Chandnani

2. Real Constant
1. Floating point numbers, numbers with decimals
2. Two types are: fractional form or exponential form.
3. It must have at least one digit.
4. It must have a decimal point.
5. Default sign is positive. It can be both positive and negative number.
6. No commas and spaces are allowed.
e.g: 12.5,36.456,-259.5 etc.

3. Character Constant
1. Single alphabet, single digit or single special character, space.
2. Enclosed in single quotes.
Eg. ‘a’ , ‘A’ , ‘=’ , ‘3’ etc.

4. String Constant
String means a group of characters
Eg. "Jyoti" "123456789" "2135.145"

5. Symbolic Constant : Name given to a value


e.g. 1. #define Size 100
2. #define FALSE 0
Advantages :
1. Can be used to assign names to values.
2. Replacement of value has to be done at one place and wherever the name appears
replaced value will appear automatically, in this way it saves time.

Constants are defined by using const keyword.


Syntax: const datatype variable_name = value;
E.g. cons int y= 10;
Jyoti Chandnani

Variables
When we want to perform some manipulations or operations on data in a program,
we need some storage that will store the data. For e.g. to add two numbers in a
program (suppose 5 +6), we need three locations, two for the input numbers (5 and
6) and one for the result (11). For storing data and performing operations and
manipulation, we need variable.
A Variable is a named memory location .It is called variable because the data stored
in the memory can be changed.
For e.g., To add two numbers (5 and 6) , we need three locations
So we can name the locations that will store 5 and 6 as num1 and num2 and the
locations that will store the sum can be named as sum or res.

Syntax for variable declaration:


<Datatype>variablename = value (optional);
int num1=5;
float num2=6.5;
int res;

or they can be combined in one line separated by comma as -


int num1=5,num2=6,res;
Here, int denotes the data type of the data that will be stored in the variable.
Each variable has specific type which will determine the size of the memory allocated
to variable and the range of values that can be stored in that memory.

Datatypes in C
Datatype of a variable denotes the type of the value that will be stored in the
variable. Different datatype will require different amount of memory, the range of
values that can be stored in the memory and the operations that can be performed
on specific types.
Let us briefly describe them one by one:
Following are the examples of some very common data types used in C:
• char: The most basic data type in C. It stores a single character and requires a
single byte of memory in almost all compilers.
• int: As the name suggests, an int variable is used to store an integer.
• float: It is used to store decimal numbers (numbers with floating point value)
with single precision.
• double: It is used to store decimal numbers (numbers with floating point value)
with double precision.
Jyoti Chandnani

Data Type Memory Range Format


(bytes) Specifier

short int 2 -32,768 to 32,767 %hd

unsigned short int 2 0 to 65,535 %hu

unsigned int 4 0 to 4,294,967,295 %u

int 4 -2,147,483,648 to 2,147,483,647 %d

long int 4 -2,147,483,648 to 2,147,483,647 %ld

unsigned long int 4 0 to 4,294,967,295 %lu

signed char 1 -128 to 127 %c

unsigned char 1 0 to 255 %c

float 4 %f

double 8 %lf

long double 16 %Lf


We can use the sizeof() operator to check the size of a variable.

Rules for creating variables:


i) First Letter: first letter of any identifier name should be an alphabet.
ii) No special character: No special character (except underscore)can be used while
naming an identifier.
iii) No Keywords: Keywords cannot be used as identifier name
iv) No White Space: White spaces like blanks, tabs and newline cannot be used.
v) Length: Maximum 31 characters are allowed to name any identifier. More that 31
is not allowed
vi) Case Sensitive: Upper case and lower case letters are treated differently.
Jyoti Chandnani

C Keywords

Keywords are the reserved words in C. These words have some pre-defined
functionality which cannot be changed. Since each keyword has some specific
function, so they cannot be used for another purpose like as a variable or function
name. There are 32 keywords in C language.
auto double int struct
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while

Installation of TurboC
Step 1: Download Turbo C++ 3.2.
Step 2: Extract “Turbo C++ 3.2 zip” file in the same directory.
Step 3: Run “Setup.exe” file and follow the instructions.
Step 4: You will get the Install Shield Wizard to Turbo C++. Click Next to continue.

Structure of C program
/*comments */
// Sample program
preprocessors
main() function{ }

user defined functions


func1 ()
funct2()

myfunc()
{
statements 1
statement 2
}
Jyoti Chandnani

First C Program:
We will write our first C Program :
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf(“\n Hello , Welcome to C Learning “);
getch();
}

→The first line in the code #includes<stdio.h> is preprocessor command which tells
the compiler to include the header file stdio.h before actual compilation. stdio.h is a
header file for standard input output which contains the definition of printf() and
scanf() functions . Similarly, conio.h is also a header file which include definition of
clrscr() and getch() used in the program.
→Every C program starts execution from the main () function and finish execution at
the end of the main ().
→void is a data type which means no return value .Here the main() does not return
any value to the OS(Operating System).
→clrscr() is an in-built function which is used to clear the output screen. It is
available in header file conio.h
→printf() is also an in-built function available in stdio.h header file. It is used to print
on the standard output.
→getch() is also an in-built function in conio.h which is used to hold the output
screen unless a user press any character from keyboard.

NOTE :
1. C language is case-sensitive means ‘x’ and ‘X’ are different.
2. Each instruction in C is written as a statement.
3. All statement should be in same order in which we want to display and execute.
4. Every statement in C program is terminated with (;) semicolon which is also called
statement terminator.
5. We can write two statements in single line separated by semicolon.
6. White spaces and tabs are ignored by the compiler that why it is also called Free
Form Language.
Jyoti Chandnani

The above program can be modified as


#include<stdio.h>
#include<conio.h>
int main()
{
clrscr();
printf(“\n Hello , Welcome to C Learning “);
getch();
return 0;
}

Difference between int main() and void main()


1. Every C program start execution from main() function. OS calls this function,
so whenever any value is returned by main() ,it is returned to the OS.
2. void means no value so in void main() the return type is void indicating no
value is returned by the main() function
3. int is an integer datatype denoting that the main() function ran return an
integer value. In the last line, return 0 is returning 0 value. This value is
returned to the OS.
4. The purpose of returning ‘0’ value is for the OS to understand that the
program has executed successfully. A return of 0 means successful execution
and a return of any other value means unsuccessful execution.
5. void main() should not be used as OS does not understand whether C program
is successfully completed or not
6. int main() should be used ideally.

C Program development Environment


Jyoti Chandnani

steps of compiling and executing the program


1.write your program in texteditor.
2.save your file . <file name > .c (sample.c)
3. compile
- syntactic error
- save & recompile (sample.obj)
4. Linking with the library.
Linking errors
5. Executable file (sample.exe)
6. Test the result of your file

Escape sequences
• \n - New line
• \r - Carriage return
• \b - Backspace
• \t - Horizontal tab
• \" - Quotation mark
• \v - Vertical tab
• \' - Apostrophe
• \\ - Backslash
• \? - Question mark
• \0 - Null
E.g.
#include<stdio.h>
#include<conio.h>
int main()
{
clrscr();
printf("\n C Programming");
printf("\r CPP");
getch();
return 0;
}

/b is used for backspace


/r means carriage return move the cursor to the beginning
Output:
CPP Programming
Jyoti Chandnani

printf() function :The printf() function is used for output.


It prints the given statement to the console.

The syntax of printf() function is given below:


printf("format string",argument_list);

The format string can be %d (integer), %c (character), %s (string), %f (float) etc.

Scanf() function used to receiving input from keyboard.

General form of scanf function is :


scanf("Format specifier",&variable,&variable,...);

scanf("%d%d",&a,&b); & - address

-Format string contains placeholders for variables that we intend to receive from
keyboard.
-A & sign comes before each variable name that comes in variable listing.
-Character strings are exceptions from this rule. They will not come with this sign
before them.

Note: You are not allowed to insert any additional characters in format string other
than placeholders and some special characters.

float a;
int n;
scanf("%d%f",&n,&a);

Pay attention that scanf function has no error checking capabilities built in it.
Programmer is responsible for validating input data (type, range etc.) and preventing
errors.

Comments in C
Comments are given to describe the purpose of the program or instructions.
Comments are never compiled. It is a good practice to start a program with comment
telling about the program, date and who has written it.
Any number of comments can be given in a program.
Single line comments can start with // (double front slashes).
e.g : // description of the program
Multiline comments should be enclosed in /* your comments */.
e.g. /* comments enclosed in these characters are multiline comments */.
Jyoti Chandnani

Operators in C

Operators in C: An expression is a combination of operands and operator that


perform a specific operation.
Operators are the special symbols which are used to perform specific functions.
Operand can be a constant or a variable.
The data on which operator is applied is called operands. (constant / variable /
expression)
e.g
+a → variable
+10 →Constant
-456 →constant
a=a+b*h →expression
a=a+5 →variable and constant

Forms of Operators.
1. Unary- If operator is applied on one operand, it is called Unary operator.
2. Binary : operator is applied on two operands.
3. Ternary : operators are applied on three operands.

Types of Operator:

Assignment Operators:
The function of this operator is to assign the value or values in variable on right hand
side of an expression to the variables on the left hand side.

Syntax : Variable = constant/variable/expression

The Expression can be :


An arithmetic operator, relational operator, logical operators or mixed expressions.

e.g. a=5 →
a=l*b*0.5; → datatype of L.H.S. should match the datatype of R.H.S.
si= (prin*rate*time);
Jyoti Chandnani

Arithmetic Operator
These are used for performing mathematical operations on numeric values. They are
unary or binary.

Operator Unary/Binary Function


‘+’ Both Addition
‘-‘ Both Substraction
‘*’ Binary Multiplication
‘/’ Binary Division
‘%’ Binary Perform modulo division,
Returns remainder of division
It can only operate on integer
values
++ Unary Increment by 1
-- Unary Decrement by 1

Rules :
Parenthesis can be used in same manner as algebraic expressions
Parentheses are at the ‘highest level of precedence’. In case of nested parenthesis
the innermost parenthesis are evaluated first.

For Eg. : (((3+4)*5)/6)


1 2 3
Multiplication, Division and Modulus operators are evaluated next.
Addition, subtraction are evaluated last.

Apart from these binary arithmetic operators C contains two more Unary Operators

Increment Operator (++) : Increment the value of variable by 1


• Preincrement
• Postincrement
Decrement operators(--): Decrement the value of variable by 1
• Predecrement
• Postdecrement

It can be only applied on numeric value stored in variable. It cannot be directly


operated on constants like ++5 will be invalid.
Preincrement/Predecrement will first increment/decrement and then assign the
value to variable.
Postincrement/postdecrement will assign the value to variable and then
incremented/decremented.
Jyoti Chandnani

E.g. n1=8;
n1++; //n1=n1+1
will change n1 value to 9.
Decrement operator or -- will decrement the value of a variable by 1
It can be only applied on numeric value stored in variable. It cannot be directly
operate on constants like --5 will be invalid.

n2=8;
n2--; //n2=n2-1
Will make n2 value to 7
Predecrement will first decrement and then assign the value to variable.
Postdecrement will assign the value to variable and then decrement.

Relational operators

These operators are used for comparing two values whether they are greater or less
than or equal or not equal to other. These operators will either return TRUE or FALSE
value. In C, False is treated as 0 and TRUE means 1.

Operator Functionality Example


== Check is two numbers are a==b
equal or not If a is equal to b, returns T else returns F
< Check is one no. is less than a<b
other or not If a is less than b, returns T, else F
> Check is one no. is greater a>b
than other or not If a is greater than b, returns T, else F
<= Check is one no. is less than a<=b
or equal to other or not If a is less than or equal to b, returns T, else F
>= Check is one no. is greater a>b
than or equal to other or If a is greater than or equal to b, returns T, else
not F
!= Check is two numbers are a!=b
not equal If a is not equal to b, it returns T, else F
Jyoti Chandnani

Logical operator
These operators are used to combine two or more conditions in a program. These
operators return TRUE or FALSE values. The AND (&&), OR(||) and NOT(!) are logical
operators.

AND (&&) returns TRUE when both the conditions are TRUE. If any of condition or
both conditions is FALSE, it returns FALSE.
For eg.: x=10 ,y=10, Z=50
(x==y && x!=Z) --> (true && true) --> true
(x!=y && x!=Z) --> (false && true) --> false

Truth table for && operator:


a b result
T T T
F T F
T F F
F F F

OR(||) return TRUE if any of the one condition or both conditions are TRUE. If both
conditions are FALSE, it returns FALSE.

For Eg :
x=10, y=10, z=50

(x==y || x!=Z) --> (true || true ) --> True


(x!=y || x!=Z) --> (false || true) --> TRUE
Truth table for || operator:
a b result
T T T
F T T
T F T
F F F

NOT(!) will complement the condition and return FALSE if condition is TRUE or
returns TRUE if condition is FALSE. It is Unary operator.
Truth table for ! operator:
A b
T F
F T

For eg.: x=10 ,y=10, Z=50


!(x==y && x!=Z) --> !(true && true) --> False
Jyoti Chandnani

Bitwise Operators
These are used to perform bit level operations i.e. each operand is first converted to
bit and then operation is performed bit-by-bit.

Operator Functionality
& (AND) Gives 1 in result when both the bits in operands are 1 ,otherwise
gives 0
|(OR) Gives 1 in the result when any one of the bit in operand is 1,if
both bits are 0,it gives 0
^(XOR) Gives 1 if both bits in operand are different, if both bits in
operand are same ,it gives 0
~(complement) Reverse the bits, makes 1 to 0, and 0 to 1
<< Left Shift, it will shift the bits to left by operand specified
>> Right shift, it will shift the bits to right by operand specified

Examples:
Let a=25 and b=39
Then a and b in binary are

a= 0001 1001 a= 0001 1001 a= 0001 1001


b=0010 0111 b= 0010 0111 b= 0010 0111 a= 0001 1001
a&b= 0000 0001 a|b= 0011 1111 a^b= 0011 1110 ~a= 1110 0110

a&b=1 a|b=63 a|b=62 ~a=230

Left Shift Operator :


a= 01111110
a<<1 will shift 1 bit to the left Ans : 11111100

Right Shift Operator


B=01111110
B>>1 = 00111111 ➔ shift 1 bit to the right
Jyoti Chandnani

How to find the binary number of any decimal


Power of Two Binary Decimal Value
0
2 0001 1
1
2 0010 2
2
2 0100 4
3
2 1000 8
4
2 0001 0000 16
5
2 0010 0000 32
6
2 0100 0000 64
7
2 1000 0000 128
8
2 0001 0000 0000 256
9
2 0010 0000 0000 512
10
2 0100 0000 0000 1,024

27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
1. A=5 = 4+1 = 0101
0 1 0 1

2.A=24 →16+8 = 00011000


0 0 0 1 1 0 0 0

3. 125=64+32+16+8+4+1 = 01111101
128 64 32 16 8 4 2 1
0 1 1 1 1 1 0 1

More examples
& (AND)
A=8 → 00001000
B=16→00010000
A&B 00000000
Truth Table of AND (&)
A B A&B
1 1 1
1 0 0
0 1 0
0 0 0

OR (|)
Jyoti Chandnani

A B A|B
1 1 1
1 0 1
0 1 1
0 0 0
A=8 → 00001000
B=16→00010000
A|B 00011000

XOR (^)
A B A^B
1 1 0
1 0 1
0 1 1
0 0 0
A=8 → 00001000
B=16→00010000
A^B 00011000

Bitwise complement operator ~


It changes 1 to 0 and 0 to 1
It is an unary operator.
It is denoted by ~ (tilde).

Eg : A=8 → 00001000
~A → 11110111 →
8 = 00001000 (In Binary)
Bitwise complement Operation of ~8
00001000
________
~ 11110111 = 247 (In decimal)
128+64+32+16+0+4+2+1 = 247

bitwise complement of 8 is 247 and 247 in 2's complement form is : 9

The bitwise complement of 8 (~8) is -9 instead of 247, but why?

because for any integer n, bitwise complement of n will be -(n+1).


8 = -(8+1) = -9

Bitwise complement of N is ~N (2's complement form)


Jyoti Chandnani

How to find 2's Complement


The 2's complement of a number is equal to the complement of that number plus 1

247 in 2's complement form is

11110111 --> 247


- 00001000 --> complement of 247 (-247)
+ 1
- 00001001 --> -9

The bitwise complement of 8 is 247 (in decimal). The 2's complement of 247 is -9.
Hence, the output is -9 instead of 247.

#include <stdio.h>
void main()
{
printf("Output = %d\n",~35); -(35+1)
printf("Output = %d\n",~-12); -(-12+1)
return 0;
}
Output

Output = -36
Output = 11

Shorthand operators
These operators are used to assign a value to a variable. The left hand side of these
operators contain a variable and right hand side contains a value. The datatype of
value and variable must be same.

Operator Functionality Example


= Assignment operator a=b
will assign value of b to a
+= This is shorthand add and assign a+=b
operator this will be same as a=a+b
-= This is shorthand subtract and assign a-=b
operator this will be same as a=a-b
*= This is shorthand multiply and assign A*=b
operator this will be same as a=a*b
Jyoti Chandnani

/= This is shorthand divide and assign a/=b


operator this will be same as a=a/b
%= This is shorthand modulus and assign a%=b
operator this will be same as a=a%b

Comma Operator :
It is used to separate a pair of expressions.
Generally comma operator is used in for loop for eg.: for(i=0,j=1;i<10;i++)

Conditional Operator:
It is C’s only ternary operator, it takes three operands. The operands together with
conditional operators form a conditional expression.

Syntax : (condition) ? (expression 1) : (expression 2)

If the condition is true first expression will be evaluated and if the condition if false
second expression will be evaluated.
For eg: x=(y<20)? 9 : 10 ; → means if y is less than 20 , then x=9 else x=10;

Type Cast Operator

When constants and variables are mixed in an expression, they are converted to the
same type. That is automatic type conversion takes place.
Rules for type conversion:
All chars and short ints are converted to int. All floats are converted to doubles .
means values of small datatype can be converted to large datatype.
Apart from automatic conversion what if we want to convert the type of variable?
What if int is to be converted to float. Yes it can be done by using cast operator.
.
Syntax : (type) expression → type is any C datatype
For example, if you want to make sure that the expression a/5 would evaluate to
type of float you write it as
Cast is an unary operator and has the same precedence as any other unary operator.
The use of cast operator id=s explained in the following example:
main()
{
int num;
printf(“%f%f%f\n”,(float)num/2,(float)num/3,(float)num/3);
}
The cast operator in this example will ensure that fractional part is also displayed on
the screen.
Jyoti Chandnani

Size of Operator

C provides a compile-time unary operator called sizeof that can be used to compute
the size of any object. The expression such as:
Sizeof object and sizeof(type name)
Result in an unsigned integer value equal to the size of the specified object or type in
bytes. Actually the resultant integer is the number of bytes required to store an
object of this type of its operand. An object can be a variable or array or structure.
An array and structure are data structures provided in C, introduced in latter units. A
type name can be the name of any basic type like int or double or a derived type like
a structure or a pointer.
For example,
sizeof(char) = 1 bytes
sizeof(int) = 2 bytes

Priority of Operators
C uses a certain hierarchy to solve such kind of mixed expression. The hierarchy ans
associatively of the operators discussed so far is summarized in Table 6. The
operators written in the same line have the same priority. The higher precedence
operators are written first.
Precedence of the operators
Operators Associativity
() Left to right
!,++,--,(type),sizeof Right to left
/,%,* Left to right
+- <<=>>= Left to right
== != Left to right
&& Left to right
|| Left to right
?: Right to left
=+=- Right to left
=*=/+%=&&=||+
, Left to right

Special Symbols: Some of the symbols have special functionality which is described
as –
1. [ ] :-used as subscripts to refer to the elements of the array
2. { } :- marks the start and end of a block which have more than one instruction
3. () :- used to denote function
4. Semicolon (;) :-used as a statement terminator.
5. *:- used as a pointer variable.

You might also like