Name: Dixit Janhavi Rajesh
Enroll. No.: 1910510124
Roll. No.: 21CO353
Practical No : 1
1) Write a simple JavaScript with HTML for arithmetic
expression evaluation.
Code :
<!DOCTYPE html>
<html>
<head>
<title>Javascript Arithmetic Operators</title>
</head>
<body>
<h1>Performing Arithmetic Operations </h1>
<script>
var m=28, n=7 ;
var addition, subtraction, multiplication, division, modulus;
addition = m + n;
subtraction = m - n;
multiplication = m * n;
division = m / n;
modulus =m % n;
document.write("Addition of " + m +' and ' + n + " is = " + addition
+ "<br />");
document.write("Subtraction of " + m +' and ' + n + " is = " +
subtraction + "<br />");
document.write("Multiplication of " + m +' and ' + n + " is = " +
multiplication + "<br />");
document.write("Division of " + m +' and ' + n + " is = " + division
+ "<br />");
document.write("Modulus of " + m +' and ' + n + " is = " +
modulus + "<br />");
</script>
</body>
</html>
Output :
2) Write a simple JavaScript with HTML for message
printing.
Code :
<html>
<script language = "javascript" >
document.write("Hello World...")
alert("Hello World!");
</script>
</html>
Output :
**********