Cyclomatic complexity is a source code complexity measurement that is being correlated to a number of coding errors. It is calculated by developing a Control Flow Graph of the code that measures the number of linearly-independent paths through a program module.
Lower the Program's cyclomatic complexity, lower the risk to modify and easier to understand. It can be represented using the below formula:
Cyclomatic complexity = E - N + P
where,
E = number of edges in the flow graph.
N = number of nodes in the flow graph.
P = number of nodes that have exit points
I advice you to refer the ink mentioned below for a clear understanding of the above concept. It's beautifully explained here. :)
http://www.tutorialspoint.com/software_testing_dictionary/cyclomatic_complexity.htm