Unit1 Algorithm
Unit1 Algorithm
Algorithm
• Algorithm is a step-by-step procedure, which defines a set of
instructions to be executed in a certain order to get the desired
output.
• Algorithms are generally created independent of underlying
languages, i.e. an algorithm can be implemented in more than one
programming language.
• From the data structure point of view, following are some important categories of algorithms
−
• Step 1: Start
• Step 2: Declare and Read 3 Subject, let’s say S1, S2, S3
• Step 3: Calculate the sum of all the 3 Subject values and store result in
Sum variable (Sum = S1+S2+S3)
• Step 4: Divide Sum by 3 and assign it to Average variable.
• (Average = Sum/3)
• Step 5: Print the value of Average of 3 Subjects
• Step 6: End