Definition of Algorithm
Algorithm :Algorithm is stepwise solution to the problem. In algorithm each step is solution of the small problem. hence algorithm is list of steps which makes complete solution of a problem.
For Example :
1. Write an algorithm to add two numbers.
step1: START
step2: Input A and B
step3: Compute ANS=A+B
step4: Print ANS
step5: STOP
2. Write an algorithm to find average of three subject marks.
In this problem sub1 is maths, sub2 is eng and sub3 is science.
step1: START
step2: Input sub1,sub2,sub3
step3: Total = sub1+sub2+sub3
step4: Avg=Total/3
step5: Print Avg
step6:stop
3. Write an algorithm to find area of circle
R is Radius, P is pi and A is area
step1: START
step2: Input R
step3: A=P*R*R
step4: Print A
step5: STOP
4. Write an Algorithm to find the greatest number among two numbers.
step1: start
step2: Input number1, number2
step3: check if number1 > number2 then go to step5
step4: Print number2 is greatest and go to last step
step5: Print number1 is greatest
step6: stop
Why Algorithms are used?
Algorithm is one of the problem solving technique or programming technique. Algorithms provides an easy way to the programmer to find the solution of problem using program.Algorithms provides logic and it is useful for our daily life also. e.g., Milk man giving milk at our home daily. We collecting raw material like how many liter given by him on each day. End of the month we calculate total liter and multiply it with the Amount per liter and get the answer. How much we have to pay to the Milk man at the end of the month? Here the algorithm is used to calculate the total and Money pay at the end of the month.
The conclusion is, We don't know but every person using algorithms or logic in their life.
Thank you,
Hitesh Vataliya.
FOR MORE INFORMATION :
Visit Our Center :
120-121, Gangotri Complex,
30 Meter Gotri Road,Near Yash Complex,
Gotri, Vadodara - 390021
Gujarat, India.
Contact No: +91 9726185104
No comments:
Post a Comment