the quotient of two integers is -5 if one of the integers is 10 what are the possible value of the other number?
Answers
Answered by
5
The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.
What you're doing in your question, with the implicit conversions made explicit, is
int A = 1;
int B = 2;
double C = (double) (A / B);
However, if you want to perform the division operation using doubles you have to explicitly cast at least one of the operands to double:
Answered by
2
- The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.
- The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.What you're doing in your question, with the implicit conversions made explicit, is
- The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.What you're doing in your question, with the implicit conversions made explicit, isint A = 1;
- The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.What you're doing in your question, with the implicit conversions made explicit, isint A = 1;int B = 2;
- The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.What you're doing in your question, with the implicit conversions made explicit, isint A = 1;int B = 2;double C = (double) (A / B);
- The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.What you're doing in your question, with the implicit conversions made explicit, isint A = 1;int B = 2;double C = (double) (A / B);However, if you want to perform the division operation using doubles you have to explicitly cast at least one of the operands to double:
Answered by
2
- The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.
- The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.What you're doing in your question, with the implicit conversions made explicit, is
- The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.What you're doing in your question, with the implicit conversions made explicit, isint A = 1;
- The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.What you're doing in your question, with the implicit conversions made explicit, isint A = 1;int B = 2;
- The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.What you're doing in your question, with the implicit conversions made explicit, isint A = 1;int B = 2;double C = (double) (A / B);
- The division operation is performed on two integers, so the result is an integer. The fact that you assign it to a double afterwards doesn't change that.What you're doing in your question, with the implicit conversions made explicit, isint A = 1;int B = 2;double C = (double) (A / B);However, if you want to perform the division operation using doubles you have to explicitly cast at least one of the operands to double:
Similar questions