Declarative programming is a term with two distinct meanings, both of which are in current use.
According to one definition, a program is "declarative" if it describes what something is like, rather than how to create it. For example, HTML web pages are declarative because they describe what the page should contain — title, text, images — but not how to actually display the page on a computer screen. This is a different approach from imperative programming languages such as Fortran, C, and Java, which require the programmer to specify an algorithm to be run. In short, imperative programs explicitly specify an algorithm to achieve a goal, while declarative programs explicitly specify the goal and leave the implementation of the algorithm to the support software (for example, a SQL select statement specifies the properties of the data to be extracted from a database, not the process of extracting the data).
According to a different definition, a program is "declarative" if it is written in a purely functional programming language, logic programming language, or constraint programming language. The phrase "declarative language" is sometimes used to describe all such programming languages as a group, and to contrast them against imperative languages.
These two definitions overlap somewhat. In particular, constraint programming and, to a lesser degree, logic programming, focus on describing the properties of the desired solution (the what), leaving unspecified the actual algorithm that should be used to find that solution (the how). However, most logic and constraint languages are able to describe algorithms and implementation details, so they are not strictly declarative by the first definition.
Similarly, it is possible to write programs in a declarative style even in an imperative programming language. This is usually done by encapsulating non-declarative details inside a library or framework. An example of this style is the use of reflection in the JUnit unit test framework, which allows unit tests to be registered with the framework merely by being defined.
In a declarative program you write (declare) a data structure that is processed by a standard algorithm (for that language) to produce the desired result.
A declarative language, like all languages, has a syntax describing how the words in the language may be combined, and a semantics describing how sentences in the language correspond to a program's output.
Reference:
http://en.wikipedia.org/wiki/Declarative_programming