+ 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)";
6 odpowiedzi
+ 5
@Happy MaCwAn 😶 I'm not cracking jokes here 😶
+ 9
@Kartikey Sahu..
alert(eval(prompt())) //js 😂
Only c++, java & c
+ 4
print(eval(input())) //Python🐍
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
- 1
lol