Rotation of a 2D array
Reduce the number of rotations

For each "ring" you rotate, the number of rotations you can do before you reach the original position again is: \$2*(rows + columns) - 4\$, where rows and columns are the number of rows and columns for the ring.  So you can reduce the number of rotations like this:

sizeOfRing = 2*(r-sr + c-sc) - 4;
rotationsForThisRing = totalRotations % sizeOfRing;


You will of course need to modify your program to use a variable number of rotations per ring.