diff --git a/Extras/Max number.js b/Extras/Max number.js deleted file mode 100644 index 319b40b..0000000 --- a/Extras/Max number.js +++ /dev/null @@ -1,8 +0,0 @@ -let arr1 = prompt("enter number 1"); -let arr11 = arr1.split(","); -let arr2 = prompt("enter number 2"); -let arr22 = arr2.split(); -let arr3 = prompt("enter number 3"); -let arr33 = arr3.split() -let total = arr11.concat(arr22 , arr33) -console.log(Math.max(...total)); \ No newline at end of file diff --git a/Extras/maxOfThreeNumbers.js b/Extras/maxOfThreeNumbers.js new file mode 100644 index 0000000..6ac3ca2 --- /dev/null +++ b/Extras/maxOfThreeNumbers.js @@ -0,0 +1,25 @@ +let a = 3; +let b = 5; +let c = 11; +if (a > b) { + if (a > c) { + console.log(a); + } else { + console.log(c); + } +} else { + if (b > c) { + console.log(b); + } + else { + console.log(c); + } +} +// let arr1 = prompt("enter number 1"); +// let arr11 = arr1.split(","); +// let arr2 = prompt("enter number 2"); +// let arr22 = arr2.split(); +// let arr3 = prompt("enter number 3"); +// let arr33 = arr3.split() +// let total = arr11.concat(arr22 , arr33) +// console.log(Math.max(...total)); \ No newline at end of file