Função quadrática
Publicado por Thiago 17/05/2005
[ Hits: 15.608 ]
Galera se tiver algum erro me notifiquem!
E viva o linux!!!
<HTML>
<HEAD>
<TITLE>FUNÇÃO DO 2º GRAU</TITLE>
</HEAD>
<BODY>
<MARQUEE><FONT COLOR=BLUE SIZE=10><B>FUNÇÃO DO 2º GRAU</B></FONT></MARQUEE>
<SCRIPT LANGUAGE="JavaScript1.3">
<!--
window.alert("==================..FUNÇÃO DO 2º GRAU..===================");
A = window.prompt("INFORME O VALOR DO COEFICIENTE (A) ","");
B = window.prompt("INFORME O VALOR DO COEFICIENTE (B) ","");
C = window.prompt("INFORME O VALOR DO COEFICIENTE (C) ","");
if((A == "") || (A == " "))
{
A = 0;
}
else if((B == "") || (B == " "))
{
B = 0;
}
else if ((C == "") || (C == " "))
{
C = 0;
}
document.write("<P>" + "FÓRMULA DA FUNÇÃO DO 2° GRAU: ax² + bx + c" + "</P>");
document.write("<P>" + "FÓRMULA DE BÁSKARA OU DELTA : b² -4 * a * c" + "</P>");
delta = ( (B * B) -(4 * (A) * (C)));
raiz = Math.sqrt(delta,2);
x1 = (-B - raiz / (2 * A));
x2 = (-B + raiz / (2 * A));
document.write("<P>" + "VALOR DE A = " + A + "</P>");
document.write("<P>" + "VALOR DE B = " + B + "</P>");
document.write("<P>" + "VALOR DE C = " + C + "</P>");
document.write("<P>" + "VALOR DE DELTA = " + delta + "</P>");
document.write("<P>" + "RAIZ DE DELTA = " + Math.round(raiz) + "</P>");
document.write("<P>" + "VALOR DE X LINHA = " + Math.round(x1) + "</P>");
document.write("<P>" + "VALOR DE X DUAS LINHAS = " + Math.round(x2) + "</P>");
if(delta < 0)
{
document.write("<P>" + "RAÍZES REAIS IMAGINÁRIAS." + "</P>");
}
else if(delta == 0)
{
document.write("<P>" + "RAIZ COMUM." + "</P>");
}
else
{
document.write("<P>" + " ============> RAÍZES REAIS DIFERENTES." + "</P>");
}
reset = window.prompt("DESEJA REINICIAR O PROGRAMA ? " + '\n' + "INFORME S.","");
if(reset == "S")
{
window.location.reload();
}
// -->
</SCRIPT>
</BODY>
</HTML>
Bloqueando o teclado do visitante
Cirurgia para acelerar o openSUSE em HD externo via USB
Void Server como Domain Control
Modo Simples de Baixar e Usar o bash-completion
Monitorando o Preço do Bitcoin ou sua Cripto Favorita em Tempo Real com um Widget Flutuante
Como quebrar senha usando john the ripper
[Resolvido] VirtualBox can't enable the AMD-V extension
Como verificar a saúde dos discos no Linux
Como instalar , particionar, formatar e montar um HD adicional no Linux?
Duas Pasta Pessoal Aparecendo no Ubuntu 24.04.3 LTS (2)
Não consigo instalar distro antiga no virtualbox nem direto no hd (20)









