Write a program to divide 2 numbets without / operator in java ?
Answers
Answered by
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
1
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
Environmental Sciences,
4 months ago
Math,
4 months ago
English,
8 months ago
Computer Science,
8 months ago
Math,
1 year ago
Math,
1 year ago
Math,
1 year ago