Professional Documents
Culture Documents
Copy of Practical 1 -SL
Copy of Practical 1 -SL
Practical No. 01
Semester/Year: III/II
AIM: Understand the concepts of Front-End Programming and create an HTML Web Page that
will accept two numbers and perform arithmetic operations using JavaScript.
Operator Description
+ Addition
- Subtraction
* Multiplication
** Exponentiation (ES2016)
/ Division
% Modulus (Remainder)
++ Increment
-- Decrement
The operation (to be performed between the two operands) is defined by an operator.
CODE:
<html>
<head>
<title>Arithmetic Operations</title>
</head>
<body>
<script type="text/javascript">
var a = 12;
var b = 34;
var result;
document.write("Value of a = " + a + " and b = "+ b);
result = a + b;
document.write("<br>Addition of a & b = " + result );
result = a - b;
document.write("<br>Subtraction of a & b = " + result );
result = a * b;
document.write("<br>Multiplication of a & b = " + result );
result = a / b;
document.write("<br>Division of a & b = " + result );
</script>
</body>
</html>
OUTPUT:
• What is operand?
REFERENCE:
• www.w3schools.com
• www.tutorialsmade.com
• https://www.edureka.co/blog/interview-questions/javascript-interview-questions/