Imperative programming is a way of describing how things work. It explicitly specifies each statement, mutating a program’s state.
Declarative programming expresses the logic without explicitly specifying its control flow. It is a way of describing what you want to do, without listing all the steps to make it work.
Let's check if a number's a palindrome the imperative way:
A declarative solution would be: