0% found this document useful (0 votes)
861 views

Practical No: 1: 1) Write A Simple Javascript With HTML For Arithmetic Expression Evaluation

This document contains details of a student named Dixit Janhavi Rajesh enrolled as 21CO353 for their practical assignment no. 1. It includes code for a JavaScript program to perform arithmetic operations and print messages. The program defines variables for two numbers, performs addition, subtraction, multiplication, division, and modulus operations on them, and prints the results. It also uses document.write and alert to print a message.

Uploaded by

JANHAVI DIXIT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
861 views

Practical No: 1: 1) Write A Simple Javascript With HTML For Arithmetic Expression Evaluation

This document contains details of a student named Dixit Janhavi Rajesh enrolled as 21CO353 for their practical assignment no. 1. It includes code for a JavaScript program to perform arithmetic operations and print messages. The program defines variables for two numbers, performs addition, subtraction, multiplication, division, and modulus operations on them, and prints the results. It also uses document.write and alert to print a message.

Uploaded by

JANHAVI DIXIT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

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 :
**********

You might also like