Descobrir se um número digitado é negativo.
Exibir a frase: "Número Negativo",
Senão:"Número Positivo"
Resposta:
<html>
<html>
<head>
<title>NEGATIVO OU POSITIVO</title>
</head>
<body>
<script type="Text/Javascript">
var numero;
numero=parseInt(prompt('Digite um número:'));
if (numero<0){
alert(numero+' é negativo.');
}
else {
alert(numero+' é positivo.');
}
</script>
</body>
</html>FLUXOGRAMA
This entry was posted
on domingo, junho 08, 2008
and is filed under
EXERCÍCIOS
.
You can leave a response
and follow any responses to this entry through the
Assinar:
Postar comentários (Atom)
.
0 comentários