Experiment No. 01 Title: - Develop Javascript To Use Decision Making and Looping Statements. D.O.P
Experiment No. 01 Title: - Develop Javascript To Use Decision Making and Looping Statements. D.O.P
EXPERIMENT NO. 01
D.O.P: -
D.O.S: -
MARKS: -
CO5I - A 2021-22
VES POLYTECHNIC CLIENT-SIDE SCRIPTING 22519
Experiment No: 01
Student Activity:
Exercise:
CO5I - A 2021-22
Student Activity:
<!DOCTYPE html>
<html lang="en">
<body>
<script>
document.write(
);
document.write(
);
</script>
</body>
</html>
Output:
2. Fibonacci series number
<!DOCTYPE html>
<html>
<body>
<script>
var a = 0, b = 1, c, i;
for(i=1;i<=num;i++)
document.write("<br>" + a);
c = a + b;
a = b;
b = c;
</script>
</body>
</html>
Output:
3. Factorial Number.
<!DOCTYPE html>
<html lang="en">
<body>
var f = 1;
f = f*i;
</script>
</body>
</html>
Output:
4. Display Even Numbers between 1 to 50
<!DOCTYPE html>
<html>
<body>
<script>
var n = 50;
for(i=0;i<=n;i++)
if(i%2 == 0)
</script>
</body>
</html>
Output:
Exercise:
• Browser Support: For running the JavaScript in the browser there isn’t any need
to use some plug-in. Almost all the popular browsers support JavaScripting.
• Run time evaluation: Using the eval function the expression can be
evaluated at run time.
We use else if to identify a new condition to test, if the first condition is false; else if
to identify a block of code to be executed, if a specified condition is true; else to
identify a block of code to be executed, if the same condition is false;
Boolean:
Boolean represents a logical entity and can havetwo values: true and
false.
Null:
The Null type has exactly one value: null. If we try to access the null value then a
runtime error will occur.
String:
Number:
Number represents integer and floating numbers (decimals and exponentials). For
example: var number1 = 3;
Objects:
Objects are variables too. But objects can contain many values. For example,
Function:
Object:
Method: