Year 1 earns regular interest A; Year 2 earns A plus interest on A (B).
The 2-year difference between CI and SI is simply B = P(R/100)²!