top of page

Java Script program to add, subtraction,multiplication, division and modulus of two Numbers




<html>

<head>

<title> Java Script program to add, subtraction,multiplicaion and division of two Numbers</title>

<script language="javascript">

function math(fnm)

{

a=parseInt(fnm.t1.value)

b=parseInt(fnm.t2.value)


fnm.t3.value=a+b

fnm.t4.value=a-b

fnm.t5.value=a*b

fnm.t6.value=a/b

fnm.t7.value=a%b

}

</script>

</head>

<body>

<form>

<br>

<b>Enter First Number : </b>

<input type="text" name="t1">

<br><br>

<b>Enter Second Number</b>

<input type="text"name="t2">

<br><br>

<input type="button"name="b1"value="Calculate" onclick="math(form)">

<br>

<b>Addition of Two Numbers</b>

<input type="text" name="t3">

<br><br>

<b>Subtraction of Two Numbers</b>

<input type="text" name="t4">

<br><br>

<br>

<b>Multiplication of Two Numbers</b>

<input type="text" name="t5">

<br>

<br>

<b>Division of Two Numbers</b>

<input type="text" name="t6">

<br>

<br>


<br>

<b>Modulus of Two Numbers</b>

<input type="text" name="t7">

<br>

<br>

</form>

</body>

</html>

Output:





436 views8 comments

Recent Posts

See All

Switch Statement in Java Script

Switch Statement: A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case and the variable being switched on is checked for each switch cas

What is CSS and its types with Examples?

CSS stands for Cascading Style Sheet. A CSS files allows us to style for HTML Content. We can present the content on our website with fonts, colors, background, borders, text formatting, links effect

Java Script program to find simple interest

<html> <head> <title> form event</title> <script language="javascript"> function si(fnm) { P=fnm.t1.value R=fnm.t2.value T=fnm.t3.value fnm.t4.value=(P*R*T)/100 } </script> </head> <body> <form> <br>

8 Comments


life savingrx
life savingrx
Feb 22, 2023

Malegra 100 mg is an oral prescription based medication approved by the FDA for the treatment of erectile dysfunction (ED) in men. Malegra 100 mg drug uses Sildenafil as an active ingredient. During the entire period you can be sure of your strength and erection will come with sexual excitement. Do not use more than one pill per day.

Like

life savingrx
life savingrx
Feb 07, 2023

Vidalista 40 is used to treat erectile dysfunction and impotence. Consuming vidalista 40 increases the blood flow which hardens the penis and keeps it longer. If you hesitate to discuss with the doctor, then you can consume this medicine even without the doctor's advice. Consumption of this medicine is not harmful to health in any way.

Like

life savingrx
life savingrx
Jan 30, 2023

Sildenafil Citrate is used as the active ingredient in fildena 100 medicine. This medicine is meant for men who are going through problems like erectile dysfunction. Avoid consuming alcohol or smoking while taking this medicine as it will not interact with this medicine.

Like

life savingrx
life savingrx
Nov 12, 2022

Do you experience impotence to get a solid erection during intercourse then you need to use cenforce medicine to easily turn this impotence into success. All men need to read cenforce 150 review, effectiveness, side effects, warnings, etc. to know all information about this drug. Cenforce medication is a low cost ED solution.

Like

life savingrx
life savingrx
Oct 08, 2022

The cause of erectile dysfunction problem is lack of blood flow to the penis and this deficiency is controlled only by tadalafil ingredient. This ingredient is found in the drug vidalista as a compound. Men who get expected results after consuming vidalista drug need to share their experience on vidalista reviews.

Like
bottom of page