Computer Science, asked by siddharthasingh15, 8 months ago

Write a program to divide 2 numbets without / operator in java ?

Answers

Answered by mehakbhatia45
0

int sign = 1;

  • if (x * y < 0) sign = -1;
  • return sign * division(Math. abs(x), Math. abs(y)); }
  • // main function to perform division of two numbers. public static void main(String[] args) {
  • int dividend = 22; int divisor = -7;
  • System. out. printf("Quotient is %d\n", divide(dividend, divisor)); } }
Answered by xXAbhiSharma45Xx
1

\huge{\underline{\red{\mathfrak{♡Answer♡}}}}

Int sign = 1;

  • if (x * y < 0) sign = -1;
  • return sign * division(Math. abs(x), Math. abs(y)); }
  • // main function to perform division of two numbers. public static void main(String[] args) {
  • int dividend = 22; int divisor = -7;
  • System. out. printf("Quotient is %d\n", divide(dividend, divisor)); } }
Similar questions