Company: Cisco_22_feb
Difficulty: medium
Below is a program that rotates an array to the right by k positions. Array rotation is a fundamental operation where elements are shifted circularly - elements from the end move to the beginning. For example, rotating [1, 2, 3, 4, 5] by 2 positions results in [4, 5, 1, 2, 3]. The input is given with the array size n and rotation count k on the first line, followed by the array elements on the second line. However, this program has errors which prevent it from achieving its intended task. Can you please make corrections to make the program work?