Wednesday, October 28, 2009

Some Common Algorithm

1.Algorithm of find the Factorial Number:

1.Start

2. (Input)Read N

3. Set

Product=1

Mult=N

4.(Repeat This Loop to 6)

While(Mult<=1)

5.Product=Product Mult(Partial Product)

6.Mult=Mult-1(End of Loop)

7.(output) Write factorial of N product.

8. End.

2.Algorithm Of Fibonacci Number:

Fibonacci(n)

{

If(n<=1) Then

Write(n)

Else

{

fnm1=0; fnm2=1;

for(i=2 to n do)

{

fn=fnm1+fnm2

fnm1=fnm2

fnm2=fn

write(fn);

}

}


Try it best.


No comments:

Post a Comment

Simple and Complete E-commerce PL/SQL Code

This is a Database of e-commerce solution. This database is quite simple but complete one.  The script (.sql file) contain all the nece...