Simple Calculator in JavaScript

Simple Calculator in JavaScript

15CSL77
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT


Program 1

Write a JavaScript to design a simple calculator to perform the following operations:
sum, product, difference and quotient.

basic format for HTML documents.

<html>
   <head></head>
   <body>
      <! -- Content -- >
   </body>
</html>
JavaScript Function We will use in this Program:
eval(expression): This function will solve the expression given as attribute.
example: eval(3+9)=12

Basic Steps

step1: Create one file with html extension(ex:- calci.html).
step2: Design body of calculator we can choose any html code of our wish.
step3: Use JavaScript function to evalute expression.

Code for Simple Calculator:


Output



Video Tutorial


No comments:

For Query and doubts!

Powered by Blogger.