0
So how does 15/4=3?? How does this below work?
Int x=15, int y=4; Int result = x / y System.out.println(result) “3”
6 odpowiedzi
+ 15
15 ÷ 4, specifically, is 3.75. However, because both operands in the equation are integers, the result of the division will be rounded down to an integer, which is why the answer is 3
+ 3
does 4 go into 15 three times and the answer is yes Bryan
3*4=12
0
my question is how does 15 divoded by 4 equal 3?
0
Beacuse Both operands are integer data type... (And the rule of operaters is it will give answer in same data type)
if you divide 15.0/4 it will give you the exect answer what you are searching
like 15.0/4.0
15(float)/4
etx there are different methods to solve it
but the main thing is operator react with operends as how larg they are
like int is a smal data type and float is larg data type then int
if there will be two data types at the opposite sides of the operand the operand automatically change the type of small data type into large...
like if i write 15/ 4.0
the program execute it like this...
15.0/4.0
then it shows the result...
i hope you understand what i want to say
0
What if u approx
0
yes bro, because both the operands are integers, the result will also be rounded down to an integer as well.