leap assigned the result of conditional expressions.
The room around it can be a little simplified:
leap = ((year % 4 == 0) && (year % 100 !=0) || (year % 400 == 0));
You will get 0 if it was not evaluated as true and 1 otherwise.
eg. for year = 2012 you get the following:
(year % 4 == 0) - this is true, so this is 1
( year % 100 != 0) - this is not true, so again it equals 1
(year % 400 == 0) - not true and equal to 0
Then substituting these expressions in their value, we get:
leap = 1 && 1 || 0; - which returns us 1;
source share