We know 60% can swim so that means 40% cannot swim. Notice how 100% - 60% = 40% Or in other words, the 60% and 40% add to 100%. This is because we have two choices: either the person can swim or cannot swim
Since 40% cannot swim, this means 40% of 30 = (40/100)*30 = 0.40*30 = 12 and we get the same result as before