Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function teste () {
- var vetor = [];
- var aux;
- for(var a=0; a<3; a++){
- vetor[a] = prompt("Digite um numero");
- }
- for(var i=0; i<3; i++) {
- for(var j=i+1;j<3;j++) {
- if(vetor[i]<vetor[j]) {
- aux = vetor[i];
- vetor[i] = vetor[j];
- vetor[j] = aux;
- }
- }
- }
- alert(vetor);
- }
- teste();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement