Classification of Programming
Languages
Declarative:
Implicit solution
"What the computer should
do" 
Functional
(Lisp,
Scheme,
ML,
Haskell)
Logic
(Prolog)
Dataflow 
Imperative:
Explicit solution
"How the computer should
do it" 
Procedural
"von Neumann" (Fortran,
C)
Objectoriented
(Smalltalk,
C++,
Java) 

Declarative functional example
(Haskell)
gcd a b
 a == b = a
 a > b = gcd (ab) b
 a < b = gcd a (ba)
Declarative logic example (Prolog)
gcd(A, A, A).
gcd(A, B, G) : A > B, N is AB, gcd(N, B, G).
gcd(A, B, G) : A < B, N is BA, gcd(A, N, G).
Imperative procedural example
(C)
int gcd(int a, int b)
{ while (a != b)
if (a > b) a = ab; else b = ba;
return a;
}
