-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestion08.js
More file actions
27 lines (20 loc) · 759 Bytes
/
Question08.js
File metadata and controls
27 lines (20 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
* 8. Escreva um algoritmo para ler 2 valores
* (considere que não serão lidos valores iguais)
* e escreve-los em ordem crescente.
*/
const prompt = require('prompt-sync')();
//digite o primeiro valor
value01 = prompt("Type the first number: ");
value02 = prompt("Type the second number: ");
function lowHighValue(value01,value02){
if(value01 > value02){
console.log("the order is as follows: ", value02,"followed by: ", value01);
}else if(value01 < value02){
console.log("the order is as follows: ", value01,"followed by: ", value02);
// a ordem é a seguinte" value01" seguido por value02
}else{
console.log("equals values!");
}
}
lowHighValue(value01,value02);