Algorithm Algorithm refers to a set of rules/instructions that step-by-step define how a work is to be executed in order to get the expected results.
Finding average marks of 3 subjects of the student. BEGIN Step 1: Accept 3 marks say M1, M2, M3 scored by the student. Step 2: Add M1, M2, M3 and store the result in Total. Step 3: Divide Total by 3 and find the Average. Step 4: Display Average END
Finding area of circle BEGIN Step 1: Accept the R. Step 2: Find the square of radius and store it in R, R=R*R Step 3: Multiply R with 3.14 and store the result in A. END
Flowchart Flowchart is a pictorial presentation of the facts presented in algorithm. It helps to reach ease of reading the algorithm since it makes use of symbolic shapes.
Flowchart Symbol Terminal: The symbol indicates beginning, end and pause(halt) program’s logic flow. Input / output: The symbol indicate input, output data from/to keyboard, mouse monitor, data files etc. Processing: This symbol indicate arithmetic processing and data movement instruction. Decision: This symbol indicates a decision point, appoint at which a branch of two or more alternative points are possible. Flow lines: This symbol indicates flow of operation.
Flow chart for calculating average marks of 3 subjects of the student. START Display AVG Calculate Total = M1+M2+M3 Calculate AVG = Total/3 Accept marks , M1, M2 , M3 END
Flow chart for calculating area of a circle START Calculate R = R*R Calculate A= 3.14*R Enter value for R END
Flow chart to print the largest of three numbers. START Read A,B, C Is A>B? Is A>C? Is B>C? Yes Yes Print A No Yes Print B Print C No END