Posts

Showing posts with the label Algorithm of a computer programming

5. Algorithm of a computer programming

An algorithm is a step by step method of solving a problem. It is commonly used for data processing, calculation and other related computer and mathematical operations.An algorithm is also used to manipulate data in various ways, such as inserting a new data item, searching for a particular item or sorting an item. Some examples of algorithm are given below : 1.  Write an algorithm to add given two numbers. Step 1: Start. Step 2: Read two numbers A and B. Step 3: Total = A+B. Step 4: Display Total. Step 5: Stop. 2.  Write an algorithm for Subtracting two Numbers. Step 1: Start. Step 2: Read two numbers A and B. Step 3: Answer = A - B. Step 4: Display SUB. Step 5: Stop. 3. Write an algorithm to find factorial of a given number. Step 1: Start Step 2: Declare variables: N, fact,  i. Step 3: Initialize variables             fact = 1             i = 1 Step 4: Read value of N from use...