Win a copy of Kotlin in Action this week in the Kotlin forum!
programming forums Java Java JSRs Mobile Certification Databases Caching Books Engineering Languages Frameworks Products This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Sheriffs:
Saloon Keepers:
Bartenders:

number puzzle

vidya sagar
Ranch Hand
Posts: 580
2_5_8_3_6=10

substitute any mathematical operators such that leftside equals to ten

fred Joly
Ranch Hand
Posts: 55
are parentheses allowed ?

vidya sagar
Ranch Hand
Posts: 580
are parentheses allowed ?

No

Arjunkumar Shastry
Ranch Hand
Posts: 986
If sequencing is not strict,then
8+3+6-2-5 = 10

vidya sagar
Ranch Hand
Posts: 580
If sequencing is not strict

No Sequence is very Strict

Stefan Wagner
Ranch Hand
Posts: 1923
Is _2_5_8_3_6=10 allowed?

- 2 - 5 + 8 + 3 + 6 = 10

vidya sagar
Ranch Hand
Posts: 580
Is _2_5_8_3_6=10 allowed?

No.Before number 2 no symbols allowed.

fred Joly
Ranch Hand
Posts: 55
Do we use Operator Precedence like in Java or simply
from left to right ?

example : 3+4*2 = 11 in Java
3+4*2 = 14 from left to right

vidya sagar
Ranch Hand
Posts: 580
Left to right only

Ryan McGuire
Ranch Hand
Posts: 1142
9
Originally posted by vidya sagar:
2_5_8_3_6=10

substitute any mathematical operators such that leftside equals to ten

2-5+8/3*6=10 (Left-to-right, no operator precedence.)

vidya sagar
Ranch Hand
Posts: 580
Well Done Ryan McGuire...

That only i expected???

fred Joly
Ranch Hand
Posts: 55
Yes, well done!

 Consider Paul's rocket mass heater.