Friday, November 19, 2021

 Algorithms in programming


 In computer programming, the algorithm is describing a computer program step by step. Before we create a computer program, we create an algorithm to get an idea about that computer program. if any problem is in that algorithm, we can correct it before we create our computer program. we use a programming language to create computer programs. but we don't need any special language to create an algorithm. We can use simple English for that. 

There are some important characteristics in algorithms. 

  1. Well-ordered.
  2. Has unambiguous operations.
  3. Produces a result.
  4. Halts in a finite amount of time.
  5. Have effectively computable operations. 
        We can use some types to make algorithms. those are as follows. 
  1. Normal English 
  2. Structured English 
       The above two methods are also known as informal methods of algorithms.
  1. Pseudo Code
  2. Flow charts 
        The above two methods are also known as formal methods of algorithms.


     Let's Look at some examples of algorithms. 
    
for example, I will show you how to make an algorithm for adding two numbers & show output on a paper by each type of algorithms 

          Normal English

  • first of all, get two numbers. 
  • then you have to add the value of both numbers into one.
  • after that print value on paper.

        Structured English

  • Get two numbers 
  • Add two numbers into one
  • Print value on paper.

        Pseudo Code

  1. Start
  2. Declare value1, value2, sumof_two_value,
  3. Get values for value1 & value2
  4. Get sum of value1 & value2 
  5. Assign sum into sumof_two_value
  6. Print sumof_two_value
  7. Stop
        Flow Chart





No comments:

Post a Comment

Reflect on the inspirational speech by Dean Furness

 We must believe ourselves. We should not compare ourselves with another person, because some person may be good at something. When we compa...