Hvem tilbyr Forbrukslån i Norge | Paras Pikavippi | Søk om Kredittkort | Strømleverandører | Beste Innbruddsalarm | Barneforsikring | Mobilselskaper i Norge | Billig Internett
JavaScript programming

Arithmetic Operator to javascript

JavaScript programming through a wide variety of mathematical operations such as addition, subtraction, multiplication, division, etc., are used to perform arithmetician operator. For example, in a by -a  (Negation), a + b by  (Addition), a – b by (Subtraction), a * b by  (Multiplication), a / b by subdivision (Division), a% by b Mod (modulus) is expressed.

Practice Project:

<html>
<head>
<title> www.trickbd.com.bd</title>
<style>
body{background: #FFC;
font-size:20px;}
h2{color:#FF0066;}
</style>

</head>
<body>
<script type = “text/javascript”>
var a = 20;
var b = 10;
var c = a+b;
var d = a-b;
var e = a*b;
var f = a/b;
var x = -a;
document.write(“<p> A = ”
+ a + “.</p>”);
document.write(“<p> B = ”
+ b + “.</p>”);
document.write(“<p>( A + B ) = C = ”
+ c + “.</p>”);
document.write(“<p>( A – B ) = D = ”
+ d + “.</p>”);
document.write(“<p>( A * B ) = E = ”
+ e + “.</p>”);
document.write(“<p>( A / B ) = F = ”
+ f + “.</p>”);
document.write(“<p>X = -a = ”
+ x + “.</p>”);
var p =25;
var q =10;
var r =p%q;
document.write(“<p>p % Q = R = ”
+ r + “.</p>”);
</script>
</body>

</html>

Notepad: to open a file type from the menu at the top of layer code by clicking on the Save as File name: index.html, Save as type: All files, save and open the index.html file with the Mozilla Firefox look like the image shown below.

A = 20.

B = 10.

( A + B ) = C = 30.

( A – B ) = D = 10.

( A * B ) = E = 200.

( A / B ) = F = 2.

X = -a = -20.

p % Q = R = 5.

  • The above program var c = a+b; Addition.
  • Program var d = a-b; Subtraction.
  • Program var e = a*b; Multiplication.
  • Program var f = a/b; Division.
  • Program var x = -a; Negation.
  • Program var r =p%q; Modulus.

PHP is the modulus for the remainder on.Forum p=25, var q=10,so  Division 5.

 

Comments

comments

About the author

Toriqul Islam Tusher

বলার মত কিছু নাই!

Leave a Comment