Saturday, August 3, 2019

what is algorithm explain with example

(8) What is Algorithm ?

] It refers to the logic of a program., it is a step description of how to arrive at a solution to a given problem. It defined as a sequence of instruction that when executed in the desired result are obtained . it is called “ algorithm”. The world algorithm comes from the name of a persion author “ abu jafer mohammed ibn musa al khwarizmi” this word has been specified significance in computer science where “ algorithm” has come to refer a method can be used by a computer of a problem.

Feature of algorithm:-  

                                                 Input.
                                                Output.
                                                Finitness.
                                                Definiteness.
                                                Effectiveness.

 How to write an algorithm:- 

Q :- adding any two no. 

            ~ Start . 
            ~ Print” enter any two no” 
            ~ Input a,b 
            ~ S= a+b 
            ~Print” the sum of two no is”,s. 
            ~End 

Start :- It shown the starting point of algorithm.

Print :- Using this we can display (print) any user defined message as per requirement. The message must be enclosed in double quote. We can also print (display) the value present in a variable. As print “the sum of two variable is” , s. 
 Or……. Print “the sum of two no”, print s. 

Input :- It is a keyword which is used to define the all variable which store the value required for our algorithm to perform task. Example :- Input a , b A&b are two variable which any two value.

End :- It is a keyword, which store the ending your algorithm.

No comments:

Post a Comment