Wednesday, 6 March 2013

Algorithm

Algorithm: It is a sequence of instructions (or set of instructions) to make a program more readable. It is a process used to answer a question. In simple words an algorithm is a step-by-step procedure for solving a problem. Algorithms can be expressed in any language, from natural languages like English to programming languages like C. We use algorithms every day. For example, a recipe for baking a cake is an algorithm. Most programs consist of algorithms. Making algorithm is one of the principal challenges in programming language. An algorithm must always terminate after a finite number of steps. Simple example of algorithm to add two numbers:
                        An algorithm must have one starting point and one or more ending point. Its starting point can be labeled as START and its ending point can be labeled as STOP. Here is example of one starting point and one ending point.
Example of adding two numbers:
Step 1: Start.
Step 2: Take three variables named num1, num2, num3.
Step 3: Input the values in two variables: num1 = 10, num2 = 5.
Step 4: Now add num1 & num2 and put its value to num3: num3 = num1 + num2. Here both operands num1 and num2 are added and its combined value is assigned to num3.
Step 5: Now print the value of num3. Your result is displayed on the screen.
Step 6: Stop.
Example of finding bigger number between two numbers with one START and two STOP:
Step 1: START.
Step 2: Take two variables named num1, num2.
Step 3: Read num1 and num2.
Step 4: if num1>num2 then
Step 5: print num1.
Step 6: STOP.
Step 7: else
Step 8: print num2.
Step 9: STOP.

12 comments:

  1. I appreciate your efforts because it conveys the message of what you are trying to say. It's a great skill to make even the person who doesn't know about the subject could able to understand the subject . Your blogs are understandable and also elaborately described. I hope to read more and more interesting articles from your blog. All the best.
    microsoft azure training in bangalore
    rpa training in bangalore
    rpa training in pune
    best rpa training in bangalore

    ReplyDelete
  2. Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article. thank you for sharing such a great blog with us.
    microsoft azure training in bangalore
    rpa training in bangalore
    rpa training in pune
    best rpa training in bangalore

    ReplyDelete
  3. Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article. thank you for sharing such a great blog with us.
    microsoft azure training in bangalore
    rpa training in bangalore
    best rpa training in bangalore
    rpa online training

    ReplyDelete
  4. Do you mind if I quote a couple of your posts as long as I provide credit and sources back to your blog? My blog is in the same niche as yours, and my users would benefit from some of the information you provide here. Please let me know if this ok with you. Thank you.
    python Online training in chennai
    python training institute in marathahalli
    python training institute in btm
    Python training course in Chennai

    ReplyDelete
  5. Simply wish to say your article is as astonishing. The clarity in your post is simply great, and I could assume you are an expert on this subject. Well with your permission let me grab your RSS feed to keep updated with forthcoming post. Thanks a million and please keep up the gratifying work.
    python training in chennai
    python course institute in chennai

    ReplyDelete
  6. It seems you are so busy in last month. The detail you shared about your work and it is really impressive that's why i am waiting for your post because i get the new ideas over here and you really write so well.
    python Course in Pune
    python Course institute in Chennai
    python Training institute in Bangalore

    ReplyDelete