0% found this document useful (0 votes)
13 views4 pages

Labset 11 7

The document contains code for a JavaScript program to perform basic arithmetic operations on two numbers by getting input from the user and displaying the output. It includes functions to add, subtract, multiply and divide two numbers.

Uploaded by

shootgamingmh
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)
13 views4 pages

Labset 11 7

The document contains code for a JavaScript program to perform basic arithmetic operations on two numbers by getting input from the user and displaying the output. It includes functions to add, subtract, multiply and divide two numbers.

Uploaded by

shootgamingmh
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/ 4

Sambhram Academy of Management Studies

<!--11.Write javascript program to perform arithemtic operations on two numbers-->


<html>
<head>
<title>JavaScript program to perform arithemetic operation</title>
<script>
function multiplyBy() {
const num1 = parseInt(document.getElementById("firstNumber").value);
const num2 = parseInt(document.getElementById("secondNumber").value);
document.getElementById("result").innerHTML = num1 * num2;
}
function divideBy() {
const num1 = parseInt(document.getElementById("firstNumber").value);
const num2 = parseInt(document.getElementById("secondNumber").value);
document.getElementById("result").innerHTML = num1 / num2;
}

function addBy() {
const num1 = parseInt(document.getElementById("firstNumber").value);
const num2 = parseInt(document.getElementById("secondNumber").value);
document.getElementById("result").innerHTML = num1 + num2;
}

function subBy() {
const num1 = parseInt(document.getElementById("firstNumber").value);
const num2 = parseInt(document.getElementById("secondNumber").value);
document.getElementById("result").innerHTML = num1 - num2;
}
</script>
</head>
<body>
<form>
<center>
<h1 color="red">Enter two numbers</h1>
1st Number : <input type="text" id="firstNumber" /><br /><br />
2nd Number: <input type="text" id="secondNumber" /><br />
<br />
<input type="button" onClick="addBy()" value="Add" />
<input type="button" onClick="subBy()" value="Subtract" />
<input type="button" onClick="multiplyBy()" value="Multiply" />
<input type="button" onClick="divideBy()" value="Divide" />

</form>
<p>

<span id="result"></span>
</p>
</center>
</body>
</html>

BCA IV SEM IT LAB PROGRAMS Prepared by Shreevalli


Sambhram Academy of Management Studies

Output:

<!--7.Create Time table using table tag-->


<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Time Table</title>
<style>
body {
font-family: Arial, sans-serif;
}
h1 {
text-align: center;
color: brown;
}
table {
width: 80%;
margin: auto;
border-collapse: collapse;
}
table,
th,
td {
border: 2px solid black;
}
th,
td {
padding: 10px;
text-align: center;
}
.lunch {
color: red;
}
.blue {
color: blue;
}
</style>

BCA IV SEM IT LAB PROGRAMS Prepared by Shreevalli


Sambhram Academy of Management Studies

</head>
<body>
<h1><b>BCA 4th Semester TIME TABLE</b></h1>
<table>
<tr>
<th></th>
<th>9.00-10.00</th>
<th>10.00-11.00</th>
<th>11.00-12.00</th>
<th>12.00-1.00</th>
<th>1.00-2.00</th>
<th>2.00-3.00</th>
<th>3.00-4.00</th>
<th>4.00-5.00</th>
</tr>
<tr>
<td>MONDAY</td>
<td>OE</td>
<td class="blue">IT LAB</td>
<td>ADA</td>
<td>SE</td>
<td rowspan="6" class="lunch">
<b>L<br />U<br />N<br />C<br />H</b>
</td>
<td>ENG</td>
<td>IL</td>
<td>Remedial class</td>
</tr>
<tr>
<td>TUESDAY</td>
<td class="blue">IT</td>
<td>SE</td>
<td>ADA</td>
<td>---</td>
<td>IL</td>
<td>ENG</td>
<td>OE</td>
</tr>
<tr>
<td>WEDNESDAY</td>
<td>OE</td>
<td class="blue">IL</td>
<td>IT</td>
<td>---</td>
<td colspan="3" class="blue">IT LAB</td>
</tr>
<tr>
<td>THURSDAY</td>
<td class="blue">IT</td>
<td>SE</td>

BCA IV SEM IT LAB PROGRAMS Prepared by Shreevalli


Sambhram Academy of Management Studies

<td>OE</td>
<td>---</td>
<td>ENG</td>
<td>IL</td>
<td>ADA</td>
</tr>
<tr>
<td>FRIDAY</td>
<td>ADA</td>
<td>IL</td>
<td>SE</td>
<td>---</td>
<td>ENG</td>
<td class="blue">IT</td>
<td>Library</td>
</tr>
<tr>
<td>SATURDAY</td>
<td>ADA</td>
<td colspan="3">PRESENTATION</td>

</tr>
</table>
</body>
</html>

Output:

BCA IV SEM IT LAB PROGRAMS Prepared by Shreevalli

You might also like