arithmetic operator Java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

arithmetic operator Java

Can anybody help me, I have and assignment from my teacher How to code x = 7*6+5/3 with the same order, and the output must be 19?

4th Mar 2020, 10:58 AM
Putri Nabila Hapsari
Putri Nabila Hapsari - avatar
6 Answers
+ 2
You have started to study the Java tutorial. Have you tried to solve it? Please show us your attempt!
4th Mar 2020, 11:00 AM
HonFu
HonFu - avatar
+ 2
HonFu Thank you so much for the answer! i have tried it. 1st attempt : I wrote x = 7*6+5/3, the output is 43 2nd attempt : x = 7*(6+5)/3, the output is 25 3rd attempt : x = 7*(6+5/3), the output is 49 4th attempt : x = (7*6+5)/3, the output is 15 5th attempt : x = 7*((6+5)/3), the output is 21
4th Mar 2020, 12:46 PM
Putri Nabila Hapsari
Putri Nabila Hapsari - avatar
+ 2
Ome Are your teacher sure about question is correct? Is there missing anything?
4th Mar 2020, 1:04 PM
Jayakrishna 🇮🇳
+ 2
Ome I think, If it 15 not 5, among all possible cases.. Then, (7*6+15)/3=19 Rest all you already tried.. And you're welcome..
4th Mar 2020, 2:01 PM
Jayakrishna 🇮🇳
+ 1
Jayakrishna Thank you for the answer! I don't know. Tbh, i kind of doubting her. I will ask her again then.
4th Mar 2020, 1:48 PM
Putri Nabila Hapsari
Putri Nabila Hapsari - avatar
+ 1
Jayakrishna Thank you so much for the answer!
5th Mar 2020, 4:43 AM
Putri Nabila Hapsari
Putri Nabila Hapsari - avatar