Created
June 13, 2018 18:39
-
-
Save AminBusiness/686256bc52ad43c7575e1a6420d2f146 to your computer and use it in GitHub Desktop.
// source https://jsbin.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Problem that accepts two answers and displays largest one | |
var num1, num2; | |
num1 = window.prompt("Input the First integer", "0"); | |
num2 = window.prompt("Input the second integer", "0"); | |
if(parseInt(num1, 10) > parseInt(num2, 10)) | |
{ | |
console.log("The larger of "+ num1+ " and "+ num2+ " is "+ num1+ "."); | |
} | |
else | |
if(parseInt(num2, 10) > parseInt(num1, 10)) | |
{ | |
console.log("The larger of "+ num1+" and "+ num2+ " is "+ num2+ "."); | |
} | |
else | |
{ | |
console.log("The values "+ num1+ " and "+num2+ " are equal."); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
//Problem that accepts two answers and displays largest one | |
var num1, num2; | |
num1 = window.prompt("Input the First integer", "0"); | |
num2 = window.prompt("Input the second integer", "0"); | |
if(parseInt(num1, 10) > parseInt(num2, 10)) | |
{ | |
console.log("The larger of "+ num1+ " and "+ num2+ " is "+ num1+ "."); | |
} | |
else | |
if(parseInt(num2, 10) > parseInt(num1, 10)) | |
{ | |
console.log("The larger of "+ num1+" and "+ num2+ " is "+ num2+ "."); | |
} | |
else | |
{ | |
console.log("The values "+ num1+ " and "+num2+ " are equal."); | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">//Problem that accepts two answers and displays largest one | |
var num1, num2; | |
num1 = window.prompt("Input the First integer", "0"); | |
num2 = window.prompt("Input the second integer", "0"); | |
if(parseInt(num1, 10) > parseInt(num2, 10)) | |
{ | |
console.log("The larger of "+ num1+ " and "+ num2+ " is "+ num1+ "."); | |
} | |
else | |
if(parseInt(num2, 10) > parseInt(num1, 10)) | |
{ | |
console.log("The larger of "+ num1+" and "+ num2+ " is "+ num2+ "."); | |
} | |
else | |
{ | |
console.log("The values "+ num1+ " and "+num2+ " are equal."); | |
}</script></body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment