[šŸ† Challenge šŸ†] Math Operation From String | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 8

[šŸ† Challenge šŸ†] Math Operation From String

If I've got a string that is a mathematic equation and I want to split it and calculate it how can we do it. If i get the input as 1+2*3,i know how to convert the string 1,2,3 to Integer.but i don't know how to covert +,* from string type to operator. ex. :- String str = "5-7+88*3%9-(77+55)";

20th Oct 2017, 12:43 PM
ŠÆ. ā™Ø
ŠÆ. ā™Ø - avatar
6 Respostas
+ 5
@Happy MaCwAn šŸ˜¶ I'm not cracking jokes here šŸ˜¶
12th Jan 2018, 12:16 PM
ŠÆ. ā™Ø
ŠÆ. ā™Ø - avatar
20th Oct 2017, 12:46 PM
Nikky Amresh
Nikky Amresh - avatar
+ 9
@Kartikey Sahu.. alert(eval(prompt())) //js šŸ˜‚ Only c++, java & c
20th Oct 2017, 1:56 PM
Nikky Amresh
Nikky Amresh - avatar
+ 4
print(eval(input())) //PythonšŸ
20th Oct 2017, 1:55 PM
Kartikey Sahu
Kartikey Sahu - avatar
0
ok.....heres the most detailed STEp BY STEP EXPLAINED VERSION.... GIVE ANY INPUT... eg...4*78-34+5.9/6 works with ^ - + Ć· Ɨ these 5 operators...but prints all step cacuations https://code.sololearn.com/cbEt2Rn86C5l/?ref=app
21st Oct 2017, 3:59 AM
sayan chandra
sayan chandra - avatar
- 1
lol
11th Jan 2018, 5:00 PM
Happy MaCwAn...