+ 1

Please help. I don’t understand question 3 of primitive operators.

8th Aug 2018, 9:14 PM
Dorcas Villacorta
8 ответов
+ 15
qestion 3 of what?
8th Aug 2018, 9:49 PM
Vukan
Vukan - avatar
+ 1
have you checked the forum on the question? and you have to specify the lesson and language or we dont know
8th Aug 2018, 9:38 PM
LordHill
LordHill - avatar
+ 1
It's simple... Just keep in mind this points : • If you use "int" then it shows only whole numbers For example - 9, 23, 1 and so on. • If you use "double " or "float " then it shows decimals also. For example - 6.23, 5.2, 0.3 and so on. • If "/" is used, then the answer is the quotient of that question. • Whereas if "%" is used, then the answer is the remainder of that question. Now to show you, here's an example - Using "/" and "int" int x = 23; int y = 5; int result = x/y; System. out. println(result); Hence the answer is 4 Using "/" and "double" double x = 23; double y = 5; double result = x/y; System. out. println(result); Hence the answer is 4.6 Using "%" and "int" int x = 23; int y = 5; int result = x%y; System. out. println(result); Hence the answer is 3 Using "%" and "double" double x = 23; double y = 5; double result = x%y; System. out. println(result); Hence the answer is 3.0 😅 sorry it's quite big.
12th Aug 2018, 3:54 AM
Tanmayee Gaikwad
Tanmayee Gaikwad - avatar
0
i dont know wich lesson
8th Aug 2018, 9:53 PM
Dorcas Villacorta
0
question 3 of primitive operators
8th Aug 2018, 9:54 PM
Dorcas Villacorta
0
which language?
8th Aug 2018, 10:03 PM
LordHill
LordHill - avatar
0
I see.. its basic division. 15/4 is 3.. technically it is 3.xxx but they are asking for an int which is a number that doesn't contain a decimal.
8th Aug 2018, 10:05 PM
LordHill
LordHill - avatar
0
there are some floats..or double float sort of thing...in that the answer had to full integer that why its 3 Because that an below 4..
10th Aug 2018, 5:25 PM
Malik idrees
Malik idrees - avatar