can't add two numbers.(take input using prompt) Help please! 🙏 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

can't add two numbers.(take input using prompt) Help please! 🙏

https://code.sololearn.com/WEnPgv3Uom8e/?ref=app

4th Jun 2020, 5:47 AM
S M Ashikur Rahman
S M Ashikur Rahman - avatar
1 Answer
+ 5
Prompt returns string type value by default so it will be concatenated not added. you have to convert them to Number using Number() https://code.sololearn.com/Ww87iJWm1Bcv/?ref=app
4th Jun 2020, 5:52 AM
Raj Chhatrala
Raj Chhatrala - avatar