Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions Javascript/program-5/program-5.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<html>
<head>
<title>MATHEMATICAL OPERATIONS OF TWO NUMBERS</title>
<script type="text/javascript">
function add()
{
var a=document.getElementById("n1").value;
var b=document.getElementById("n2").value;
var c=parseInt(a)+parseInt(b);
document.getElementById("Results").value=c;
}
function sub()
{
var a=document.getElementById("n1").value;
var b=document.getElementById("n2").value;
var c=parseInt(a)-parseInt(b);
document.getElementById("Results").value=c;
}
function mul()
{
var a=document.getElementById("n1").value;
var b=document.getElementById("n2").value;
var c=parseInt(a)*parseInt(b);
document.getElementById("Results").value=c;
}
function div()
{
var a=document.getElementById("n1").value;
var b=document.getElementById("n2").value;
var c=parseInt(a)/parseInt(b);
document.getElementById("Results").value=c;
}
</script>
<body>
<form>
ENTER NUMBER1:<input type="text" id="n1" size="20"/><br>
ENTER NUMBER2:<input type="text" id="n2" size="20"/><br>
<input type="button" value="+" onclick="add()"/>
<input type="button" value="-" onclick="sub()"/>
<input type="button" value="*" onclick="mul()"/>
<input type="button" value="/" onclick="div()"/>
Reset:<input type="Reset" value="Reset"/>
Result:<input type="text" id="Results"/>
</form>
</body>
</html>

4 changes: 4 additions & 0 deletions Javascript/program-5/read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Program-5
## This is a javascript program for mathematical operations


17 changes: 17 additions & 0 deletions Javascript/program-6/program-6.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<html>
<head>
<title> CHARACTER PROCESSING METHODS</title>
<Script type="text/javascript">
var s="ZEBRA";
var s2="AbCdEfG";
document.writeln("<p>Character at index 0 in"+s+" is"+s.charAt(0));
document.writeln("<br/>character code at index 0 in "+s+" is"+s.charCodeAt(0));
document.writeln("<p> "+s2+" in lower case is"+s2.toLowerCase());
document.writeln("<br/>"+s2+"in upper case is"+s2.toUpperCase());
document.writeln("<p>"+String.fromCharCode(87,79,82,68)+" contains character codes 87,79,82,68."+"</p>");

</script>
</head>
<body>
</body>
</html>
3 changes: 3 additions & 0 deletions Javascript/program-6/read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Program-4
## This is a javascript program for character processing