PSP Unit 1 AlgorithmsFlowchart 29 6 2022 3pm
PSP Unit 1 AlgorithmsFlowchart 29 6 2022 3pm
THROUGH PROGRAMMING
Course Instructor
Dr. Umadevi V
Department of CSE, BMSCE
Webpage:https://sites.google.com/site/drvumadevi/
Properties of an Algorithm
Input: An algorithm may or may not require input
Output: Each algorithm is expected to produce at least
one result
Definiteness: Each instruction must be clear and
unambiguous.
Finiteness: If the instructions of an algorithm are
executed, the algorithm should terminate after finite
number of steps
Step-1: Start
Step-2: Input two numbers say A and B
Step-3: Compute SUM = A + B
Step-4: Display SUM
Step-5: Stop
Step-1: Start
Step-2: Input Radius of Circle say R
Step-3: Area = 3.142 x R x R
Step-4: Circumference = 2 x 3.142 x R
Step-5: Display Area, Circumference
Step-6: Stop
Algorithm
Step-1: Start
Step-2: Input two numbers say NUM1,NUM2
Step-3: IF NUM1 > NUM2 THEN
print largest is NUM1
ELSE print largest is NUM2
ENDIF
Step-4: Stop
Algorithm
Step-1: Start
Step-2: Input two numbers say NUM1,NUM2 Flowchart
Step-3: IF NUM1 > NUM2 THEN
print largest is NUM1
ELSE print largest is NUM2
ENDIF
Step-4: Stop
Input Value
Algorithm Flowchart
Step-1: Start
Step-2: Input number say NUM Start
Step-3: Remainder=NUM%2
Step-3: IF Remainder == 0 THEN Enter NUM
Print Even
ELSE
Remainder= NUM % 2
Print Odd
ENDIF
Step-4: Stop
True If False
Remainder ==0
Print Even
Print Odd
Note:
% is a remainder Operator,
Which returns the remainder value
Stop
February 25, 2024 CSE, BMSCE 14
Algorithm & Flowchart to Swap Two Numbers using Temporary Variable
My contact details
Dr. Umadevi V, Associate Professor, Department of CSE, BMSCE
Staff Room: 4th floor, New Academic block
8762742909