Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <script>
  2. var Temp = new Array(10);
  3. var i = 0;
  4. var media;
  5. var maior = 0;
  6. var menor = 0;
  7. var menorq = 0;
  8. var dia = 0;
  9. for (i=0;i<10;i++){
  10. dia++;
  11. Temp[i] = parseInt(prompt("Digite a temperatura do " + dia + "º dia: "));
  12. }
  13. for (i=0;i<10;i++){
  14. if (i==0){
  15. menor=Temp[i];
  16. }
  17. if(Temp[i]<menor){
  18. menor=Temp[i];
  19. }
  20. }
  21. document.write("A menor temperatura do ano foi: " + menor);
  22. for(i=0;i<10;i++){
  23. if(i==0){
  24. maior=Temp[i];
  25. }
  26. if(Temp[i]>maior){
  27. maior=Temp[i];
  28. }
  29. document.write("A maior temperatura do ano foi: " + maior);
  30. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement