SlideShare a Scribd company logo
1 of 51
SHROFF S R ROTARY
INSTITUTE OF CHEMICAL
TECHNOLOGY
COMPUTER PROGRAMMING AND
UTILIZATION
ME SECOND SEMESTER
PREPARED BY:
NAVED FRUITWALA (150990119006)
UTKARSH GANDHI (150990119007)
DIGVIJAYSINH GOHIL (150990119008)
TOPIC:
ALGORITHMS, FLOW
CHARTS, HARDWARE,
SOFTWARE, STRUCTURE OF
C PROGRAM , C TOKENS.
ALGORITHMS:
• An algorithm is the finite set of sequential
instructions to accomplish a task where instructions
are written in natural languages like English. It is
also called as a step by step solution of the
problem.
• Space complexity specifies the amount of memory
space required by the algorithm for performing the
desired task.
PROPERTIES/CHARACTERISTIC
S OF THE ALGORITHM:
• Algorithm has four properties, that are finiteness, definiteness,
effectiveness, input and output. They are explained below.
• Finiteness: Total number of steps used in algorithm should
be finite.
• Definiteness: Each step of algorithm must be clear and
unambiguous.
• Effectiveness: Every step must be basic and essential.
• Input & Output: The algorithm must accept zero or more
input and must produce at least one output.
ADVANTAGES:
• Very easy to write.
• Easy technique to understand topic.
• Easy identification of the mistakes by non computer
person.
Disadvantages:
• Time consuming.
• Difficult to show branching and looping.
• Big tasks are difficult to put in algorithm.
EXAMPLES:
1) Write an algorithm to calculate area of rectangle.
• Algorithm:
Step 1: Accept the value of length i.e. L
Step 2: Accept the value of breadth i.e. B
Step 3:Calculate area i.e. A=L*B
Step 4: Print Area i.e. Print A
Step 5: Stop procedure
FLOWCHARTS:
• A flowchart can be define as the pictorial
representation of a process which describes the
sequence and flow of control and information within
the process.
• The various symbols used in a flowchart.
Symbol Name Uses
Start and stop
symbols
Used to start
flow chart as
well as to
terminate the
flow chart.
Input / Output Used for IO
operation
Process Used to mention
ALU and data
transfer task(i.e.
Arithmetic or
assignment
start
stop
Yes/true
Decision For branching
condition
Flow lines Indicates flow
Loop Indicates finite
loop
Connectors Connecting flow
lines from
different places
Tes
t
?
no/
fals
e
initializ
ation
Next
A
A
Multiple
section
For multiple
branching
condition
Block Indicates block of
statements or
body of loop
Module call Calling the
subroutine or
function
Test
?
ADVANTAGES :
• Easy to draw.
• Easy technique to understand logic.
• Easy to identify the mistakes by non computer person.
• Easy for branching and looping.
Disadvantages :
• Time consuming.
• Difficult for modification.
• Difficult task to draw flow charts for big problems.
EXAMPLES :
1) Draw a flow chart to find the average of marks
obtained by a student in three subjects.
• Flow chart :
start
Read marks 1,2,3
Avg= marks (1+2+3)/3
Print avg
stop
HARDWARE• Hardware is the physical
components which are
touchable and sensible.
It is mainly divided into 4
parts-CPU, input device,
output device and
auxiliary memory.
• CPU is the Central
Processing Unit which
contain electronics
circuit and used to
execute instructions and
also controls the
operation of other input
HARDWARE
• CPU accepts information from user through input
device. There are many input devices like
keyboard, mouse, microphone, tracker balls, touch
screens.
• CPU conveys information to user through output
devices. There are many output devices like
monitor, LCD, printers, plotters, speaker.
• Auxiliary memory is also called as a secondary
memory or external memory or magnetic memory.
This is permanent memory. User can store data
COMPUTER SOFTWARE
PROGRAM IS THE COLLECTION OF INSTRUCTIONS, WHICH
PERFORMS PARTICULAR TASK, AND COLLECTION OF
PROGRAMS WHICH ACCOMPLISHES APPLICATION (THAT
MEANS NUMBER OF TASKS) IS CALLED AS A SOFTWARE. THIS
SOFTWARE IS CLASSIFIED INTO TWO CATEGORIES - SYSTEM
SOFTWARE AND APPLICATION SOFTWARE. SYSTEM
SOFTWARE DIRECTLY INTERACTS WITH COMPUTER
HARDWARE, WHEREAS APPLICATION SOFTWARE IS ONLY
DESIGNED TO SOLVE USER PROBLEMS AS PER USERS
REQUIREMENT.
TYPES OF SOFTWARE :- (1) SYSTEM SOFTWARE
(2)APPLICATION SOFTWARE
System Software
System software is classified into 3 categories:
(1) Operating System
(2)system support software and
(3) system development software
• Operating system manages hardware as well as interacts with
user‚ and provides different services to users. There are many
operating systems like DOS, Windows-XP,VISTA‚ LINUX etc.
• System support software manages hardware more efficiently. for
example drivers of the IO devices or antivirus software.
• System development software supports programming
development environment to user. It include editor, pre-processors,
compiler, interpreter, loader etc.
• Editor is the software ‚ which is used to create
programs as well as it is used for modification of existing
programs.
• Pre-processor is the software which is used before
translators (that means compiler or editors) , which is
used to replace some segments of code With some
another segment. It is also called as an expansion.
• Compilers are the software which can translate high
level programs into low level programs.
• Interpreters are the software which can translate line by
line high level programs into low level programs
• Loaders are the software which can load object codes
into the main memory and execute it.
APPLICATION SOFTWARE
• Application software is classified into two categories :
General purpose Software and Special purpose
software.
• General purpose software is used for many number of
tasks, and provides many features for example word
processor, oracle, excel etc.
• Special purpose software is designed for Specific
purposes only. User programs comes under special
purpose software for example pay roll system for specific
STRUCTURE OF C PROGRAM
Documentation Section
/*It tells purpose of C programs, author name and etc */
//Program to add 2 nos
Link Section
#include<stdio.h>
Definition Section
#define PI 3.1414
cont…….
Global Declaration Section
Main() function Section
main()
{
Variable declaration/Initialization Section;
Program statements or Executable Section;
}
Subprogram Section
Function1()
{
Variable declaration/Initialization Section;
Program statements or Executable Section;
}
Function2()
{}
• Documentation section consists of comments.
Comments are not executed by the compiler. Single line
comments start with // symbol and multiple line
comments are written within /* and */.
• Link section consists of pre-processor directives which
link the compiler to the standard library functions. We
include different predefined standard library functions in
our C programs.
#include <stdio.h> is a header file that consists of
standard input/output functions like pritnf(), scanf() etc.
#include<math.h> consists of different math functions like
sqrt(), log() etc.
#include<graphics.h> consists of different graphical
functions.
• Definition section defines all symbolic constants like
#define PI 3.14.
• Global declaration section declares the global variables.
These variables can be used in more than one functions.
• main() function is the special and important function used
by C programs to tell the compiler where the program
starts. Every program must have exactly one main()
function.
• The opening { and closing braces } indicate the begin
and end of the main() function.
• Subprogram section contains all user defined functions
that are called in main() functions.
C TOKENS :-
•Smallest individual units in a program are
known as Tokens. The compiler recognizes
them for building up expressions and
statements.
1. KEYWORDS :-
• C language has 32 reversed keywords.
• Since keywords have specific meaning, we cannot use
them as identifiers.
• All keywords are to be written in lower-case letters.
• C keywords :-
auto extern sizeof break static
case for struct char goto
float switch if int
etc…
2. IDENTIFIERS :-
• Alphabets, digits, underscores are permitted.
• They must not begin with a digit.
• First character must be a letter.
• Uppercase and lower case letters are distinct.
• VALID INVALID
A 4abc
Roll_no Roll-no
num2 num-2
3. CONSTANTS :-
• Constants are the identifier that represent fixed values.
• First type is String Character & Literals :-
• Second type is Numeric constants :-
a.) Integer constant
1.) Octal constant
2.) Hex constant
3.) Decimal constant
b.) Floating point constant
4. SYMBOLS :-
5. OPERATORS :-
• It is a symbol that takes one or more operands
(variables, expressions or values) and operates on them
to give an output.
• There are many types of operators :-
1.)Arithmetic
2.)Relational
3.)Logical
4.)Bitwise
5.)Assignment
6.)Unary
7.)Conditional
8.)Special operator
DEFINITION
“An operator is a symbol (+,-,*,/)
that directs the computer to
perform certain mathematical or
logical manipulations and is
usually used to manipulate data
and variables”
Ex: a+b
OPERATORS IN C
1. Arithmetic operators
2. Relational operators
3. Logical operators
4. Assignment operators
5. Increment and decrement operators
6. Conditional operators
7. Bitwise operators
8. Special operators
ARITHMETIC OPERATORS
Operator example Meaning
+ a + b Addition –unary
- a – b Subtraction- unary
* a * b Multiplication
/ a / b Division
% a % b Modulo division- remainder
EXAMPLE 1
X = 9-12/3+3*2-1
= 9-4+6-1
=10
RELATIONAL OPERATORS
Operator Meaning
< Is less than
<= Is less than or equal to
> Is greater than
>= Is greater than or equal to
== Equal to
!= Not equal to
Logical Operators
Operator Meaning
&& Logical AND
|| Logical OR
! Logical NOT
Logical expression or a compound relational
expression-
An expression that combines two or more
relational expressions .
Ex: if (a==b && b==c)
TRUTH TABLE
a b
Value of the expression
a && b a || b
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 1
ASSIGNMENT OPERATORS
Syntax:
v op = exp;
Where v = variable,
op = shorthand assignment operator
exp = expression
Ex: x=x+3
x+=3
SHORTHAND ASSIGNMENT OPERATORS
Simple assignment
operator
Shorthand operator
a = a+1 a + =1
a = a-1 a - =1
a = a* (m+n) a * = m+n
a = a / (m+n) a / = m+n
a = a %b a %=b
INCREMENT & DECREMENT OPERATORS
C supports 2 useful operators namely
1. Increment ++ operators
2. Decrement -- operators
The ++ operator adds a value 1 to the operand
The – operator subtracts 1 from the operand
++a or a++
--a or a--
RULES FOR ++ & -- OPERATORS
1. These require variables as their operands
2. When postfix either ++ or – is used with the
variable in a given expression, the
expression is evaluated first and then it is
incremented or decremented by one
3. When prefix either ++ or – is used with the
variable in a given expression, it is
incremented or decremented by one first
and then the expression is evaluated with
the new value
EXAMPLES FOR ++ & -- OPERATORS
Let the value of a =5 and b=++a then
a = b =6
Let the value of a = 5 and b=a++ then
a =5 but b=6
i.e.:
1. A prefix operator first adds 1 to the operand
and then the result is assigned to the variable
on the left
2. A postfix operator first assigns the value to
the variable on left and then increments the
operand.
EXAMPLE 1:
Evaluate the expression when a=4
b=a- ++a
=a – 5
=5-5
=0
CONDITIONAL OPERATORS
Syntax:
exp1 ? exp2 : exp3
Where exp1,exp2 and exp3 are expressions
Working of the ? Operator:
Exp1 is evaluated first, if it is nonzero(1/true) then the expression2
is evaluated and this becomes the value of the expression,
If exp1 is false(0/zero) exp3 is evaluated and its value becomes
the value of the expression
Ex: m=2;
n=3
r=(m>n) ? m : n;
BITWISE OPERATORS
These operators allow manipulation of data at the
bit level.
Operator Meaning
& Bitwise AND
| Bitwise OR
^ Bitwise exclusive OR
<< Shift left
>> Shift right
SPECIAL OPERATORS
1. Comma operator ( ,)
2. sizeof operator – sizeof( )
3. Pointer operators – ( & and *)
4. Member selection operators – ( . and -
>)
ARITHMETIC EXPRESSIONS
Algebraic expression C expression
axb-c a*b-c
(m+n)(x+y) (m+n)*(x+y)
a*b/c
3x2+2x+1 3*x*x+2*x+1
a/b
S=(a+b+c)/2
c
ab
b
a
2
cba S=
ARITHMETIC EXPRESSIONS
Algebraic expression C expression
area= area=sqrt(s*(s-a)*(s-b)*(s-c))
sin(b/sqrt(a*a+b*b))
tow1=sqrt((rowx-rowy)/2+tow*x*y*y)
tow1=sqrt(pow ((rowx–rowy)/2,2)+tow*x*y*y)
y=(alpha+beta)/sin(theta*3.1416/180)+abs(x)
))()(( csbsass 
Sin








 22
ba
b
2
1
2
xy
yx


 





 

2
2
1
2
xy
yx


 





 

xy 




sin
THANK YOU

More Related Content

What's hot

Compiler Design(NANTHU NOTES)
Compiler Design(NANTHU NOTES)Compiler Design(NANTHU NOTES)
Compiler Design(NANTHU NOTES)guest251d9a
 
Compiler Design(Nanthu)
Compiler Design(Nanthu)Compiler Design(Nanthu)
Compiler Design(Nanthu)guest91cc85
 
Cs6660 compiler design
Cs6660 compiler designCs6660 compiler design
Cs6660 compiler designhari2010
 
what is compiler and five phases of compiler
what is compiler and five phases of compilerwhat is compiler and five phases of compiler
what is compiler and five phases of compileradilmehmood93
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1Manoj Patil
 
Compiler designs presentation final
Compiler designs presentation  finalCompiler designs presentation  final
Compiler designs presentation finalilias ahmed
 
Techniques & applications of Compiler
Techniques & applications of CompilerTechniques & applications of Compiler
Techniques & applications of CompilerPreethi AKNR
 
Part II: Assembly Fundamentals
Part II: Assembly FundamentalsPart II: Assembly Fundamentals
Part II: Assembly FundamentalsAhmed M. Abed
 
Different phases of a compiler
Different phases of a compilerDifferent phases of a compiler
Different phases of a compilerSumit Sinha
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingPhases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingMukesh Tekwani
 
Error detection recovery
Error detection recoveryError detection recovery
Error detection recoveryTech_MX
 

What's hot (20)

Compiler lecture 03
Compiler lecture 03Compiler lecture 03
Compiler lecture 03
 
The Phases of a Compiler
The Phases of a CompilerThe Phases of a Compiler
The Phases of a Compiler
 
Unit 1 cd
Unit 1 cdUnit 1 cd
Unit 1 cd
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
Compiler Design(NANTHU NOTES)
Compiler Design(NANTHU NOTES)Compiler Design(NANTHU NOTES)
Compiler Design(NANTHU NOTES)
 
Compiler Design
Compiler DesignCompiler Design
Compiler Design
 
Cpcs302 1
Cpcs302  1Cpcs302  1
Cpcs302 1
 
Compiler Design(Nanthu)
Compiler Design(Nanthu)Compiler Design(Nanthu)
Compiler Design(Nanthu)
 
Cs6660 compiler design
Cs6660 compiler designCs6660 compiler design
Cs6660 compiler design
 
what is compiler and five phases of compiler
what is compiler and five phases of compilerwhat is compiler and five phases of compiler
what is compiler and five phases of compiler
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
Compiler designs presentation final
Compiler designs presentation  finalCompiler designs presentation  final
Compiler designs presentation final
 
Techniques & applications of Compiler
Techniques & applications of CompilerTechniques & applications of Compiler
Techniques & applications of Compiler
 
Phases of compiler
Phases of compilerPhases of compiler
Phases of compiler
 
Part II: Assembly Fundamentals
Part II: Assembly FundamentalsPart II: Assembly Fundamentals
Part II: Assembly Fundamentals
 
Design of a two pass assembler
Design of a two pass assemblerDesign of a two pass assembler
Design of a two pass assembler
 
Different phases of a compiler
Different phases of a compilerDifferent phases of a compiler
Different phases of a compiler
 
Compiler Design Material
Compiler Design MaterialCompiler Design Material
Compiler Design Material
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingPhases of the Compiler - Systems Programming
Phases of the Compiler - Systems Programming
 
Error detection recovery
Error detection recoveryError detection recovery
Error detection recovery
 

Similar to SR ROTARY INSTITUTE COMPUTER PROGRAMMING TOPICS

Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingSangheethaa Sukumaran
 
Fundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxFundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxVigneshkumar Ponnusamy
 
final Unit 1-1.pdf
final Unit 1-1.pdffinal Unit 1-1.pdf
final Unit 1-1.pdfprakashvs7
 
Introduction to c
Introduction to cIntroduction to c
Introduction to cAjeet Kumar
 
Computer Programming In C.pptx
Computer Programming In C.pptxComputer Programming In C.pptx
Computer Programming In C.pptxchouguleamruta24
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Problem-solving and design 1.pptx
Problem-solving and design 1.pptxProblem-solving and design 1.pptx
Problem-solving and design 1.pptxTadiwaMawere
 
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.pptBCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.pptKirti Verma
 
Unit1 111206003944-phpapp02
Unit1 111206003944-phpapp02Unit1 111206003944-phpapp02
Unit1 111206003944-phpapp02riddhi viradiya
 
isa architecture
isa architectureisa architecture
isa architectureAJAL A J
 
object oriented programming part inheritance.pptx
object oriented programming part inheritance.pptxobject oriented programming part inheritance.pptx
object oriented programming part inheritance.pptxurvashipundir04
 
C programming for Computing Techniques
C programming for Computing TechniquesC programming for Computing Techniques
C programming for Computing TechniquesAppili Vamsi Krishna
 
Algorithmic problem sloving
Algorithmic problem slovingAlgorithmic problem sloving
Algorithmic problem slovingMani Kandan
 

Similar to SR ROTARY INSTITUTE COMPUTER PROGRAMMING TOPICS (20)

Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Fundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxFundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptx
 
final Unit 1-1.pdf
final Unit 1-1.pdffinal Unit 1-1.pdf
final Unit 1-1.pdf
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
Computer Programming In C.pptx
Computer Programming In C.pptxComputer Programming In C.pptx
Computer Programming In C.pptx
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Problem-solving and design 1.pptx
Problem-solving and design 1.pptxProblem-solving and design 1.pptx
Problem-solving and design 1.pptx
 
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.pptBCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
 
Unit1 111206003944-phpapp02
Unit1 111206003944-phpapp02Unit1 111206003944-phpapp02
Unit1 111206003944-phpapp02
 
isa architecture
isa architectureisa architecture
isa architecture
 
C programming
C programmingC programming
C programming
 
object oriented programming part inheritance.pptx
object oriented programming part inheritance.pptxobject oriented programming part inheritance.pptx
object oriented programming part inheritance.pptx
 
Plc part 3
Plc  part 3Plc  part 3
Plc part 3
 
c#.pptx
c#.pptxc#.pptx
c#.pptx
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
C programming for Computing Techniques
C programming for Computing TechniquesC programming for Computing Techniques
C programming for Computing Techniques
 
C for Engineers
C for EngineersC for Engineers
C for Engineers
 
Lecture 01 2017
Lecture 01 2017Lecture 01 2017
Lecture 01 2017
 
Algorithmic problem sloving
Algorithmic problem slovingAlgorithmic problem sloving
Algorithmic problem sloving
 
System software 5th unit
System software 5th unitSystem software 5th unit
System software 5th unit
 

More from Digvijaysinh Gohil

Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)Digvijaysinh Gohil
 
Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)Digvijaysinh Gohil
 
Proxemics (Communication Skills)
Proxemics (Communication Skills)Proxemics (Communication Skills)
Proxemics (Communication Skills)Digvijaysinh Gohil
 
Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)Digvijaysinh Gohil
 
Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)Digvijaysinh Gohil
 
Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)Digvijaysinh Gohil
 
Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)Digvijaysinh Gohil
 
Organizing a contents &amp; preparing an outline
Organizing a contents &amp; preparing an outlineOrganizing a contents &amp; preparing an outline
Organizing a contents &amp; preparing an outlineDigvijaysinh Gohil
 
Organizing a contents &amp; preparing an outline (2)
Organizing a contents &amp; preparing an outline (2)Organizing a contents &amp; preparing an outline (2)
Organizing a contents &amp; preparing an outline (2)Digvijaysinh Gohil
 
Kinesics (Communication Skills)
Kinesics (Communication Skills)Kinesics (Communication Skills)
Kinesics (Communication Skills)Digvijaysinh Gohil
 
Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)Digvijaysinh Gohil
 
Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)Digvijaysinh Gohil
 
Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)Digvijaysinh Gohil
 
Email etiquette (Communication Skills)
Email etiquette (Communication Skills)Email etiquette (Communication Skills)
Email etiquette (Communication Skills)Digvijaysinh Gohil
 
Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )Digvijaysinh Gohil
 
Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...Digvijaysinh Gohil
 
Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )Digvijaysinh Gohil
 

More from Digvijaysinh Gohil (20)

Hydraulic cranes
Hydraulic cranesHydraulic cranes
Hydraulic cranes
 
Hydraulic braking systems
Hydraulic braking systemsHydraulic braking systems
Hydraulic braking systems
 
Human resources management
Human resources managementHuman resources management
Human resources management
 
Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)
 
Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)
 
Proxemics (Communication Skills)
Proxemics (Communication Skills)Proxemics (Communication Skills)
Proxemics (Communication Skills)
 
Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)
 
Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)
 
Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)
 
Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)
 
Organizing a contents &amp; preparing an outline
Organizing a contents &amp; preparing an outlineOrganizing a contents &amp; preparing an outline
Organizing a contents &amp; preparing an outline
 
Organizing a contents &amp; preparing an outline (2)
Organizing a contents &amp; preparing an outline (2)Organizing a contents &amp; preparing an outline (2)
Organizing a contents &amp; preparing an outline (2)
 
Kinesics (Communication Skills)
Kinesics (Communication Skills)Kinesics (Communication Skills)
Kinesics (Communication Skills)
 
Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)
 
Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)
 
Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)
 
Email etiquette (Communication Skills)
Email etiquette (Communication Skills)Email etiquette (Communication Skills)
Email etiquette (Communication Skills)
 
Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )
 
Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...
 
Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )
 

Recently uploaded

Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 

Recently uploaded (20)

Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 

SR ROTARY INSTITUTE COMPUTER PROGRAMMING TOPICS

  • 1. SHROFF S R ROTARY INSTITUTE OF CHEMICAL TECHNOLOGY COMPUTER PROGRAMMING AND UTILIZATION ME SECOND SEMESTER PREPARED BY: NAVED FRUITWALA (150990119006) UTKARSH GANDHI (150990119007) DIGVIJAYSINH GOHIL (150990119008)
  • 2. TOPIC: ALGORITHMS, FLOW CHARTS, HARDWARE, SOFTWARE, STRUCTURE OF C PROGRAM , C TOKENS.
  • 3. ALGORITHMS: • An algorithm is the finite set of sequential instructions to accomplish a task where instructions are written in natural languages like English. It is also called as a step by step solution of the problem. • Space complexity specifies the amount of memory space required by the algorithm for performing the desired task.
  • 4. PROPERTIES/CHARACTERISTIC S OF THE ALGORITHM: • Algorithm has four properties, that are finiteness, definiteness, effectiveness, input and output. They are explained below. • Finiteness: Total number of steps used in algorithm should be finite. • Definiteness: Each step of algorithm must be clear and unambiguous. • Effectiveness: Every step must be basic and essential. • Input & Output: The algorithm must accept zero or more input and must produce at least one output.
  • 5. ADVANTAGES: • Very easy to write. • Easy technique to understand topic. • Easy identification of the mistakes by non computer person. Disadvantages: • Time consuming. • Difficult to show branching and looping. • Big tasks are difficult to put in algorithm.
  • 6. EXAMPLES: 1) Write an algorithm to calculate area of rectangle. • Algorithm: Step 1: Accept the value of length i.e. L Step 2: Accept the value of breadth i.e. B Step 3:Calculate area i.e. A=L*B Step 4: Print Area i.e. Print A Step 5: Stop procedure
  • 7. FLOWCHARTS: • A flowchart can be define as the pictorial representation of a process which describes the sequence and flow of control and information within the process. • The various symbols used in a flowchart.
  • 8. Symbol Name Uses Start and stop symbols Used to start flow chart as well as to terminate the flow chart. Input / Output Used for IO operation Process Used to mention ALU and data transfer task(i.e. Arithmetic or assignment start stop
  • 9. Yes/true Decision For branching condition Flow lines Indicates flow Loop Indicates finite loop Connectors Connecting flow lines from different places Tes t ? no/ fals e initializ ation Next A A
  • 10. Multiple section For multiple branching condition Block Indicates block of statements or body of loop Module call Calling the subroutine or function Test ?
  • 11. ADVANTAGES : • Easy to draw. • Easy technique to understand logic. • Easy to identify the mistakes by non computer person. • Easy for branching and looping. Disadvantages : • Time consuming. • Difficult for modification. • Difficult task to draw flow charts for big problems.
  • 12. EXAMPLES : 1) Draw a flow chart to find the average of marks obtained by a student in three subjects. • Flow chart : start Read marks 1,2,3 Avg= marks (1+2+3)/3 Print avg stop
  • 13. HARDWARE• Hardware is the physical components which are touchable and sensible. It is mainly divided into 4 parts-CPU, input device, output device and auxiliary memory. • CPU is the Central Processing Unit which contain electronics circuit and used to execute instructions and also controls the operation of other input
  • 14. HARDWARE • CPU accepts information from user through input device. There are many input devices like keyboard, mouse, microphone, tracker balls, touch screens. • CPU conveys information to user through output devices. There are many output devices like monitor, LCD, printers, plotters, speaker. • Auxiliary memory is also called as a secondary memory or external memory or magnetic memory. This is permanent memory. User can store data
  • 15.
  • 16.
  • 17.
  • 18. COMPUTER SOFTWARE PROGRAM IS THE COLLECTION OF INSTRUCTIONS, WHICH PERFORMS PARTICULAR TASK, AND COLLECTION OF PROGRAMS WHICH ACCOMPLISHES APPLICATION (THAT MEANS NUMBER OF TASKS) IS CALLED AS A SOFTWARE. THIS SOFTWARE IS CLASSIFIED INTO TWO CATEGORIES - SYSTEM SOFTWARE AND APPLICATION SOFTWARE. SYSTEM SOFTWARE DIRECTLY INTERACTS WITH COMPUTER HARDWARE, WHEREAS APPLICATION SOFTWARE IS ONLY DESIGNED TO SOLVE USER PROBLEMS AS PER USERS REQUIREMENT. TYPES OF SOFTWARE :- (1) SYSTEM SOFTWARE (2)APPLICATION SOFTWARE
  • 19. System Software System software is classified into 3 categories: (1) Operating System (2)system support software and (3) system development software • Operating system manages hardware as well as interacts with user‚ and provides different services to users. There are many operating systems like DOS, Windows-XP,VISTA‚ LINUX etc. • System support software manages hardware more efficiently. for example drivers of the IO devices or antivirus software. • System development software supports programming development environment to user. It include editor, pre-processors, compiler, interpreter, loader etc.
  • 20. • Editor is the software ‚ which is used to create programs as well as it is used for modification of existing programs. • Pre-processor is the software which is used before translators (that means compiler or editors) , which is used to replace some segments of code With some another segment. It is also called as an expansion. • Compilers are the software which can translate high level programs into low level programs. • Interpreters are the software which can translate line by line high level programs into low level programs • Loaders are the software which can load object codes into the main memory and execute it.
  • 21. APPLICATION SOFTWARE • Application software is classified into two categories : General purpose Software and Special purpose software. • General purpose software is used for many number of tasks, and provides many features for example word processor, oracle, excel etc. • Special purpose software is designed for Specific purposes only. User programs comes under special purpose software for example pay roll system for specific
  • 22. STRUCTURE OF C PROGRAM Documentation Section /*It tells purpose of C programs, author name and etc */ //Program to add 2 nos Link Section #include<stdio.h> Definition Section #define PI 3.1414 cont…….
  • 23. Global Declaration Section Main() function Section main() { Variable declaration/Initialization Section; Program statements or Executable Section; } Subprogram Section Function1() { Variable declaration/Initialization Section; Program statements or Executable Section; } Function2() {}
  • 24. • Documentation section consists of comments. Comments are not executed by the compiler. Single line comments start with // symbol and multiple line comments are written within /* and */. • Link section consists of pre-processor directives which link the compiler to the standard library functions. We include different predefined standard library functions in our C programs.
  • 25. #include <stdio.h> is a header file that consists of standard input/output functions like pritnf(), scanf() etc. #include<math.h> consists of different math functions like sqrt(), log() etc. #include<graphics.h> consists of different graphical functions.
  • 26. • Definition section defines all symbolic constants like #define PI 3.14. • Global declaration section declares the global variables. These variables can be used in more than one functions. • main() function is the special and important function used by C programs to tell the compiler where the program starts. Every program must have exactly one main() function. • The opening { and closing braces } indicate the begin and end of the main() function. • Subprogram section contains all user defined functions that are called in main() functions.
  • 27. C TOKENS :- •Smallest individual units in a program are known as Tokens. The compiler recognizes them for building up expressions and statements.
  • 28. 1. KEYWORDS :- • C language has 32 reversed keywords. • Since keywords have specific meaning, we cannot use them as identifiers. • All keywords are to be written in lower-case letters. • C keywords :- auto extern sizeof break static case for struct char goto float switch if int etc…
  • 29. 2. IDENTIFIERS :- • Alphabets, digits, underscores are permitted. • They must not begin with a digit. • First character must be a letter. • Uppercase and lower case letters are distinct. • VALID INVALID A 4abc Roll_no Roll-no num2 num-2
  • 30. 3. CONSTANTS :- • Constants are the identifier that represent fixed values. • First type is String Character & Literals :- • Second type is Numeric constants :- a.) Integer constant 1.) Octal constant 2.) Hex constant 3.) Decimal constant b.) Floating point constant
  • 32. 5. OPERATORS :- • It is a symbol that takes one or more operands (variables, expressions or values) and operates on them to give an output. • There are many types of operators :- 1.)Arithmetic 2.)Relational 3.)Logical 4.)Bitwise 5.)Assignment 6.)Unary 7.)Conditional 8.)Special operator
  • 33. DEFINITION “An operator is a symbol (+,-,*,/) that directs the computer to perform certain mathematical or logical manipulations and is usually used to manipulate data and variables” Ex: a+b
  • 34. OPERATORS IN C 1. Arithmetic operators 2. Relational operators 3. Logical operators 4. Assignment operators 5. Increment and decrement operators 6. Conditional operators 7. Bitwise operators 8. Special operators
  • 35. ARITHMETIC OPERATORS Operator example Meaning + a + b Addition –unary - a – b Subtraction- unary * a * b Multiplication / a / b Division % a % b Modulo division- remainder
  • 36. EXAMPLE 1 X = 9-12/3+3*2-1 = 9-4+6-1 =10
  • 37. RELATIONAL OPERATORS Operator Meaning < Is less than <= Is less than or equal to > Is greater than >= Is greater than or equal to == Equal to != Not equal to
  • 38. Logical Operators Operator Meaning && Logical AND || Logical OR ! Logical NOT Logical expression or a compound relational expression- An expression that combines two or more relational expressions . Ex: if (a==b && b==c)
  • 39. TRUTH TABLE a b Value of the expression a && b a || b 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 1
  • 40. ASSIGNMENT OPERATORS Syntax: v op = exp; Where v = variable, op = shorthand assignment operator exp = expression Ex: x=x+3 x+=3
  • 41. SHORTHAND ASSIGNMENT OPERATORS Simple assignment operator Shorthand operator a = a+1 a + =1 a = a-1 a - =1 a = a* (m+n) a * = m+n a = a / (m+n) a / = m+n a = a %b a %=b
  • 42. INCREMENT & DECREMENT OPERATORS C supports 2 useful operators namely 1. Increment ++ operators 2. Decrement -- operators The ++ operator adds a value 1 to the operand The – operator subtracts 1 from the operand ++a or a++ --a or a--
  • 43. RULES FOR ++ & -- OPERATORS 1. These require variables as their operands 2. When postfix either ++ or – is used with the variable in a given expression, the expression is evaluated first and then it is incremented or decremented by one 3. When prefix either ++ or – is used with the variable in a given expression, it is incremented or decremented by one first and then the expression is evaluated with the new value
  • 44. EXAMPLES FOR ++ & -- OPERATORS Let the value of a =5 and b=++a then a = b =6 Let the value of a = 5 and b=a++ then a =5 but b=6 i.e.: 1. A prefix operator first adds 1 to the operand and then the result is assigned to the variable on the left 2. A postfix operator first assigns the value to the variable on left and then increments the operand.
  • 45. EXAMPLE 1: Evaluate the expression when a=4 b=a- ++a =a – 5 =5-5 =0
  • 46. CONDITIONAL OPERATORS Syntax: exp1 ? exp2 : exp3 Where exp1,exp2 and exp3 are expressions Working of the ? Operator: Exp1 is evaluated first, if it is nonzero(1/true) then the expression2 is evaluated and this becomes the value of the expression, If exp1 is false(0/zero) exp3 is evaluated and its value becomes the value of the expression Ex: m=2; n=3 r=(m>n) ? m : n;
  • 47. BITWISE OPERATORS These operators allow manipulation of data at the bit level. Operator Meaning & Bitwise AND | Bitwise OR ^ Bitwise exclusive OR << Shift left >> Shift right
  • 48. SPECIAL OPERATORS 1. Comma operator ( ,) 2. sizeof operator – sizeof( ) 3. Pointer operators – ( & and *) 4. Member selection operators – ( . and - >)
  • 49. ARITHMETIC EXPRESSIONS Algebraic expression C expression axb-c a*b-c (m+n)(x+y) (m+n)*(x+y) a*b/c 3x2+2x+1 3*x*x+2*x+1 a/b S=(a+b+c)/2 c ab b a 2 cba S=
  • 50. ARITHMETIC EXPRESSIONS Algebraic expression C expression area= area=sqrt(s*(s-a)*(s-b)*(s-c)) sin(b/sqrt(a*a+b*b)) tow1=sqrt((rowx-rowy)/2+tow*x*y*y) tow1=sqrt(pow ((rowx–rowy)/2,2)+tow*x*y*y) y=(alpha+beta)/sin(theta*3.1416/180)+abs(x) ))()(( csbsass  Sin          22 ba b 2 1 2 xy yx             2 2 1 2 xy yx             xy      sin