Online Java Compiler By
JavaTpoint.com
public class IntegerRotateRightExample4 { public static void main(String[] args) { int a = -185; int shifts = 0; while (shifts < 3) // It will return the value obtained by right rotation { a = Integer.rotateRight(a, 2); System.out.println("Value: "+a); shifts++; } } }
Output