Thursday, March 21, 2013

Javascript: Algebra Calculator

function emc(){ a = Number(document.calculator.number1.value); b = Number(document.calculator.number2.value); c = a*a +2*a*b +b*b; document.calculator.total.value = c; JavaScript: Algebra Calculator, If you are having any kind of Problem in Algebra; then here a simple calculator which can calculate the value of  (a + b)2 = (a2 + 2ab + b2)



function emc(){    
a = Number(document.calculator.number1.value);
b = Number(document.calculator.number2.value);
c = a*a +2*a*b +b*b;    
document.calculator.total.value = c;   
}

form name="calculator"
Enter value of a input name="number1" type="text"
Enter value of b : input name="number2" type="text"
input name="total" type="text"
input onclick="javascript:emc();" type="button" value="Calculate"

No comments:

Post a Comment