dirask
ENPL1
HomeCommunities
IT Knowledge
SnippetsWikifor CodeQuestions
Inspiration
NewsFindings
Snippets
Browse Code Snippets

js add two numbers from user input (prompt)

JavaScript
[Edit]
+
0
-
0

js add two numbers from user input (prompt)

Laylah-WalshLaylah-Walsh
624
1 2 3 4 5 6 7 8 9
// get numbers from user const number1 = parseInt(prompt('Enter the first number:')); const number2 = parseInt(prompt('Enter the second number:')); // add numbers const sum = number1 + number2; // display result console.log(`The sum of ${number1} and ${number2} is equal to ${sum}`);
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Donate with PayPal button
Direct link
Join to our subscribers to be up to date with content, news and offers.
Native Advertising

Get your tech brand or product in front of software developers.

For more information Contact us

Dirask - we help you to
solve coding problems.
Ask question.
= +
Features
Home
Snippets
Wiki
Questions
Findings
About
About & Contact
Service Terms
Cookies Policy
Privacy Policy
GDPR Privacy Policy
Policies
Other
Code Formatters
Funny Generators
Post Lists
Social Links
© 2022 dirask - created with passion