Multiplication Table
Multiplication Table
Multiplication Table
Multiplication Table
<html>
<head>
<title>Multiplication Table</title>
<script type="text/javascript">
var rows = prompt("How many rows for your multiplication table?");
var cols = prompt("How many columns for your multiplication table?");
if(rows == "" || rows == null)
rows = 10;
if(cols== "" || cols== null)
cols = 10;
createTable(rows, cols);
function createTable(rows, cols)
{
var j=1;
var output = "<table border='1' width='500' cellspacing='0'cellpadding='5'>";
for(i=1;i<=rows;i++)
{
output = output + "<tr>";
while(j<=cols)
{
output = output + "<td>" + i*j + "</td>";
j = j+1;
}
output = output + "</tr>";
j = 1;
}
output = output + "</table>";
document.write(output);
}
</script>
</head>
<body>
</body>
</html>
2. 1. Write a JavaScript program to display the current day and time in the following format. Go
to the editor
Current time is : 10 PM : 30 : 38
hour=12;
prepand=' Noon';
else
hour=12;
prepand=' PM';
hour=12;
prepand=' Midnight';
else
{
hour=12;
prepand=' AM';
console.log("Current Time : "+hour + prepand + " : " + minute + " : " + second);
Write a JavaScript program to find the area of a triangle where lengths of the three of its sides are 5,
6, 7.
var side1 = 5;
var side2 = 6;
var side3 = 7;
console.log(area);
return (year % 100 === 0) ? (year % 400 === 0) : (year % 4 === 0);
console.log(leapyear(2016));
console.log(leapyear(2000));
console.log(leapyear(1700));
console.log(leapyear(1800));
console.log(leapyear(100));
console.log(message);
function fToC(fahrenheit)
console.log(message);
cToF(60);
fToC(45);
return str.split("").sort().join("");
console.log(alphabet_Soup("Python"));
console.log(alphabet_Soup("Exercises"));