In: Computer Science
USING HTML JAVASCRIPT
Dear Student ,
As per requirement submitted above kindly find below solution.
Question 1:
Here new web page with name "1Sample.html" is created which contains below code.
1Sample.html :
<!DOCTYPE html>
<html lang="en">
<head>
<!-- title for web page -->
<title>Sequence using Javascript</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!-- script is used for javascript -->
<script>
var odd=7;//declaring variable to store odd number
var i=10;
//using while loop loop
while(i<=626)
{
//display value of i
document.write(i+" , ");
//add odd into i
i=i+odd;
//add 2 into odd
odd=odd+2;
}
</script>
</body>
</html>
==================================
Output :Open web page 1Sample.html in the browser and will get the screen as shown below.
Screen 1:1Sample.html
**********************************
Question 2:
<!DOCTYPE html>
<html lang="en">
<head>
<!-- title for web page -->
<title>Multiplication of even numbers</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!-- script is used for javascript -->
<script>
var i=1; //declaring variable as strting number
var evenTotal=1;//variable used to store multiplication
//using while loop loop
while(i<=12)
{
//checking number
if(i%2==0)
{
//if number is even then
//multiply ecenTotal by i
evenTotal=evenTotal*i;
}
//increment value of i
i=i+1
}
//display multiplication of even numbers from 1 to 12
document.write("Multiplication of even numbers from 1 to 12 : "+evenTotal);
</script>
</body>
</html>
**********************************
Screen 1:
NOTE :PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.