Can you help me show these 3 variables in order please, in this case I can't use arrays
let num1 = 6;
let num2 = 4;
let num3 = 7;
console.log(`Los números ordenados de mayor a menor son... nombeVariable`)
Can you help me show these 3 variables in order please, in this case I can't use arrays
let num1 = 6;
let num2 = 4;
let num3 = 7;
console.log(`Los números ordenados de mayor a menor son... nombeVariable`)
Good day,
You can create a function and use
if
nested to order themIf the numbers were a, b and c then you would have all of the following combinations:
To order the values you have to compare if the first number is less than or equal to the second and if the second is less than or equal to the third for each of the previous combinations
So you could do something like this: