Your Only Destination To Empower Your Computer Programing Knowledge. Sky is not so high, You can Touch it if You Try
Showing posts with label Algorithm. Show all posts
Showing posts with label Algorithm. Show all posts

Finding factorial of a number:Algorithm,Flowchart

This article is about find factorial of a number.Before any discussion we should know what is factorial?
Factorial of a number=number!
Ex.factorial of 6!=6*5*4*3*2*1=120
factorial of 0!=1
Algorithm and flowchart:-In previous articles Algorithm of roots of polynomial equation and flowchart of roots of polynomial equation we discuss algorithm and flowchart of square roots of polynomial equation.I think you get some idea about algorithm and flowchart from previous articles.for more understanding about the concept we discuss factorial of a number.
Problem:Finding factorial of a number n
Algorithm:-
Step:1 Start
Step:2 Read a number n
Step:3 if(n<0)
write"factorial of negative numbers is not possible" and exit
(end of if statement)
Step:4 if(n=0)
write"factorial of 0=1" and exit
Step:5 fact=1
for(m=1;m<=n;m++)
{
fact= fact*m
}
Step:6 write"factorial".
Step:7 Stop

flowchart:-
flowchart of factorial of a number n

Friends,
I think you will get something from this.If there is any wrong concept then please highlight it.As no one is perfect.Thanks for visit...........stay in touch.

Finding square roots of polynomial equation in mathematics:Flowchart........

This article about making flow chart of quadratic equation.Flowchart as we discuss in previous article Basic definition of algorithm and flowchart is a graphical representation of algorithm.In previous article Algorithm of quadratic equation we made algorithm of quadratic equation.in this article we try to make flowchart of that equation.This flowchart is not proper representation of algorithm but helps to understand the logic of making flowchart.
basic symbols used in flowcharts are:-





SymbolMeaning
This structure is called terminator in flowcharts. It is used for both start and stop. Here is start structure in flowcharts.
The given structure, rectangle, is used to indicate processing or computing in a flowchart.
This structure is the diamond structure and it is the decision making structure in flowcharts. Statement is written in the diamond and left right nodes are used for yes and no of the statement. It means it decides the flow of the algorithm.
The given structure is a parallelogram and it is used to prompt for inputs like asking to enter integer values in variables and also used to display results.

Flowchart of square roots of quadratic equation is:-

friends,
This is the flow chart of roots of quadratic equation.i hope you learn how to draw flowchart.Thanks for visit.....

Finding square root of a polynomial equation in mathematics : Algorithm

This article explains how to find the square root of a mathematical equation using Algorithm.

Friends,
In previous article Algorithm and Flowchart we discussed basics about computing like Algorithm and flowcharts. In current article we'll discuss How to find square root of a mathematical equation using Algorithm?

Finding Square root by algorithm


Problem : Find square root of equation a.x2+b.x+c=0 using algorithm.
Algorithm
Step 1: start
step 2: initialize a,b,c x1,x2 as float
step 3: input x,a,b and c
step 4: d=b*b-4*a*c
step 5: if(d<0)
write"roots are not real"
x1=(-b+sqrt(d)/2*a)
x2=(-b-sqrt(d)/2*a)
write"x1,x2"
(end of if statement)

if(d>=0)
write "roots are real"
root1=(-b+sqrt(d)/2*a)
root2=(-b-sqrt(d)/2*a)
write"x1,x2"
(end of if statement)
step:6 end
friends,
I will discuss solution of this problem by flowchart soon............

Algorithm, Flowchart and Programming : Basics, Definition and Examples

This article deals with algorithm, flowchart and programming concepts. It discuss definition of algorithm, flowchart and programming with proper examples.

Friends,
In my recent article Introduction to my blog, I discussed that this blog is dedicated to those who want to learn programming and that too vey fast and in effective way.
Before proceeding to the programming and programming languages one must know thee things viz. Algorithm, Flowchart and programming.
Programming is the most advanced version of the other two.
Here is a bit discussion of these three :

Algorithm


Algorithm starts with the problem. Algorithm is the analytical way of solving a problem.
in case of Algorithm a standard set of commands are given and we have to calculate or solve the problem for answer.
Algorithm is done step by step and in any case First step is named as start and last as stop.
To understand it in a better way let us consider some examples :
General Life Example
Problem : Prepare some food of your own choice.
Algorithm :
Step 1: Start
Step 2: Decide the food item to be prepared.
Step 3: Buy the necessary items including vegetables etc. if needed.
Step 4: Get the recipe, if not known to you.
Step 5: Prepare the food as per recipe.
Step 6: Serve the food.
Step 7: Stop.
Technical Example
Problem : Add two numbers in computer.
This is a technical problem and one thing you must understand that whenever you declare a number it must be initialized i.e it must be declared to have some space in memory and must have an initial value to avoid unnecessary errors.
Algorithm :
Step 1: Start
Step 2: Name the number one as 'a' and second number as 'b'.
Step 3: Enter the value of 'a' in memory space available for 'a' and similar store 'b' in memory space available for 'b'.
Step 4: Initialize a variable 'c' that have starting value 0.
Step 5: Add the numbers and store the result in 'c'.
Step 6: Display the value in 'c'.
Step 7: Stop

Flowchart


Flowchart is the graphical representation of algorithm. In flowchart various symbols are used to represent various actions.
Here are some examples:





SymbolMeaning
This structure is called terminator in flowcharts. It is used for both start and stop. Here is start structure in flowcharts.
The given structure, rectangle, is used to indicate processing or computing in a flowchart.
This structure is the diamond structure and it is the decision making structure in flowcharts. Statement is written in the diamond and left right nodes are used for yes and no of the statement. It means it decides the flow of the algorithm.
The given structure is a parallelogram and it is used to prompt for inputs like asking to enter integer values in variables and also used to display results.

This is the general information on flowcharts. In future posts we'll discuss specific flowcharts.

Programming


From above discussion it is clear that all three i.e. Algorithm, Flowchart and programming are interconnected.
Algorithm and flowchart indicates the way by which the problem can be solved or the method that can be adopted to solve the problem while programing is the implementing the method into a computer or machine.
In next article we'll discuss about various programming languages.