Calculate 7 n / 8 without using division and multiplication operators | Java program to evaluate ceil ( 7 n / 8 ) without using * and ; Note the inner bracket here . This is needed because precedence of ' - ' operator is higher than ' < < ' ; Driver code
import java . io . * ; class GFG { static int multiplyBySevenByEight ( int n ) { return ( n - ( n >> 3 ) ) ; } public static void main ( String args [ ] ) { int n = 9 ; System . out . println ( multiplyBySevenByEight ( n ) ) ; } }