LÓGICA DA PROGRAMAÇÃO

POSITIVO OU NEGATIVO?  

Postado por SOL

Descobrir se um número digitado é negativo.
Exibir a frase: "Número Negativo",
Senão:"Número Positivo"

Resposta:

<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 . You can leave a response and follow any responses to this entry through the Assinar: Postar comentários (Atom) .

0 comentários