0% found this document useful (0 votes)
7 views25 pages

Simple Javascript Program

The document contains a series of JavaScript programming tasks and solutions, including event-driven programs, mathematical operations, and form handling. It covers various functionalities such as changing background color, calculating sums, and handling user inputs through prompts and forms. Additionally, it includes HTML code snippets for creating forms to collect data like college and employee information.

Uploaded by

jayantdevare10
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views25 pages

Simple Javascript Program

The document contains a series of JavaScript programming tasks and solutions, including event-driven programs, mathematical operations, and form handling. It covers various functionalities such as changing background color, calculating sums, and handling user inputs through prompts and forms. Additionally, it includes HTML code snippets for creating forms to collect data like college and employee information.

Uploaded by

jayantdevare10
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JAVASCRIPT PROGRAMS

1. Write a JavaScript code to change background color of document area at run


time, use onmouseup event handler of button.
2. Write a JavaScript code to check number entered in textbox contains only
numbers(digits, comma allowed) using inbuilt JavaScript function. If not
display message not a number.
3. Write JavaScript code to print division of 2 numbers.
4. Write JavaScript code when user click on button, it will display sum of even
numbers from 1 to 10.
5. Write JavaScript code to accept a number and display the cube of a given
number when mouse is placed over button.
6. Write JavaScript code to accept two numbers and display the largest
number.
7. Write an even driven JavaScript program to display length of the text
"Information Technology" on click of a button.
8. Write an even driven JavaScript program to display table of accepted
number. (E.g. 2x1=2 2x2=4 )
9. Write an event driven JavaScript program to accept 2 numbers and display
which number is greater.
10. Write an event driven JavaScript program to accept a base and height and
display perimeter of a parallelogram. (Hint Perimeter of parallelogram = 2 x
base + 2 x height)
11. Write an event driven Javascript program to accept three numbers and
display addition and multiplication of the numbers.
12. Write an event driven JavaScript program to call a function after 2000
milliseconds and display text 'Hello'
13. Write an event driven JavaScript program to display factorial of number 23
when mouse is moved on the button.
14. Write an event driven JavaScript program to display number sequence from
100 to 500 when the mouse is moved over a button.
15. Write an event driven JavaScript program to display square of a number
and cube of an accepted number on click of a button.
16. Write an event driven JavaScript program to display square of numbers
from 2 to 10 on click of a button.
17. Write JavaScript code to print factorial of accepted number.
18. Write JavaScript code to print multiplication table of 3.

JS Programs with solutions


[Link] JavaScript code to print subtraction of 2 numbers.

<html>
<head>
<title>JS program to subtract two numbers</title>
</head>

<body>
<script>
var n1, n2, diff;
n1=parseInt(prompt("Enter first number:"));
n2=parseInt(prompt("Enter second number:"));
diff=n2-n1;
alert("Subtraction - " + diff);
</script>
</body>
</html>

[Link] JavaScript code to print addition of 2 numbers.

<html>
<head>
<title>JS program to add two numbers</title>
</head>

<body>
<script>
var n1, n2, sum;
n1=parseInt(prompt("Enter first number:"));
n2=parseInt(prompt("Enter second number:"));
sum=n1+n2;
alert("Sum- " + sum);
</script>
</body>
</html>

[Link] JavaScript code to print multiplication of 2 numbers.

<html>
<head>
<title>JS program to multiply two numbers</title>
</head>

<body>
<script>
var n1, n2, prod;
n1=parseInt(prompt("Enter first number:"));
n2=parseInt(prompt("Enter second number:"));
prod=n1*n2;
alert("Product - " + prod);
</script>
</body>
</html>
[Link] JavaScript code to print division of 2 numbers.

<html>
<head>
<title>JS program to divide two numbers</title>
</head>

<body>
<script>
var n1, n2, q;
n1=parseInt(prompt("Enter first number:"));
n2=parseInt(prompt("Enter second number:"));
q=n1/n2;
alert("Division - " + q);
</script>
</body>
</html>

[Link] JavaScript code to print addition, subtraction, multiplication & division


of 2 numbers.

<html>
<head>
<title>JS program to add, subtract, multiply, divide two
numbers</title>
</head>

<body>
<script>
var n1, n2, s,d,m,q;
n1=parseInt(prompt("Enter first number:"));
n2=parseInt(prompt("Enter second number:"));
s=n1+n2;
d=n2-n1;
m=n1*n2;
q=n1/n2;
[Link]("<br>Sum - " + s);
[Link]("<br>Difference - " + d);
[Link]("<br>Product - " + m);
[Link]("<br>Division - " + q);
</script>
</body>
</html>
[Link] JavaScript code to display area of circle, accept value from user.
[Link] JavaScript code to print area of triangle.

<html>
<head>
<title>JS program to calculate area of circle</title>
</head>

<body>
<script>
var r, area;
r=parseInt(prompt("Enter radius of the circle:"));

area=3.14*r*r;
alert("Area - " + area);
</script>
</body>
</html>

[Link] JavaScript code to calculate the average of three numbers.

<html>
<head>
<title>JS program to calculate average of three numbers</title>
</head>

<body>
<script>
var n1, n2, n3 avg;
n1=parseInt(prompt("Enter first number:"));
n2=parseInt(prompt("Enter second number:"));
n3=parseInt(prompt("Enter third number:"));
avg=(n1+n2+n3)/3;
alert("Average - " + avg);
</script>
</body>
</html>

[Link] JavaScript code to print perimeter of rectangle.

<html>
<head>
<title>JS program to calculate perimeter of rectangle</title>
</head>
<body>
<script>
var length, breadth, p;
length=parseInt(prompt("Enter length of the rectangle:"));
breadth=parseInt(prompt("Enter breadth of the rectangle:"));

p=2*(length+breadth);
alert("Perimeter- " + p);
</script>
</body>
</html>

[Link] JavaScript code to print perimeter of trapezium.

<html>
<head>
<title>JS program to calculate perimeter of trapezium</title>
</head>

<body>
<script>
var a, b, c, d, p;
a=parseInt(prompt("Enter length of the first side of trapezium:"));
b=parseInt(prompt("Enter length of the second side of trapezium:"));
c=parseInt(prompt("Enter length of the third side of trapezium:"));
d=parseInt(prompt("Enter length of the fourth side of trapezium:"));

p=a+b+c+d;
alert("Perimeter - " + p);
</script>
</body>
</html>

[Link] JavaScript code to check whether the number is odd or even.

<html>
<head>
<title>JS program to check number is odd or even</title>
</head>

<body>
<script>
var n;
n=parseInt(prompt("Enter a number:"));
if(n%2==0)
alert("Number is even");
else
alert("Number is odd");
</script>
</body>
</html>

12. Write JavaScript code to enter two values and display the largest.

<html>
<head>
<title>JS program to find largest number</title>
</head>

<body>
<script>
var n1, n2;
n1=parseInt(prompt("Enter first number:"));
n2=parseInt(prompt("Enter second number:"));
if(n1>n2)
alert("Larger number - " + n1);
else
alert("Larger number - " + n2);

</script>
</body>
</html>

13. Write JavaScript code to print multiplication table of 3.

<html>
<head>
<title>JS program to print multiplication table of 3</title>
</head>

<body>
<script>
var n=3, i;
[Link]("Multiplication table of 3");
for(i=1;i<=10;i++)
{
[Link]("<br>"+n+" * "+i+" = "+n*i);
}

</script>
</body>
</html>

[Link] JavaScript code to print numbers from 1 to 10.

<html>
<head>
<title>JS program to print numbers from 1 to 10</title>
</head>

<body>
<script>
var i;
[Link]("Numbers from 1 to 10");
for(i=1;i<=10;i++)
{
[Link]("<br>"+i);
}

</script>
</body>
</html>

[Link] JavaScript code to print sum of 50 natural numbers.

<html>
<head>
<title>JS program to print sum of 50 natural numbers.</title>
</head>

<body>
<script>
var i, sum=0;
[Link]("Sum of numbers from 1 to 50");
for(i=1;i<=50;i++)
{
[Link]("<br>"+i);
sum=sum+i;
}
[Link]("<br>Sum - "+sum);

</script>
</body>
</html>
[Link] JavaScript code to print all even numbers from 10 to 50.

<html>
<head>
<title>JS program to print even numbers from 10 to 50</title>
</head>

<body>
<script>
var i;
[Link]("Even Numbers from 10 to 50");
for(i=10;i<=50;i++)
{
if(i%2==0)
[Link]("<br>"+i);
}

</script>
</body>
</html>

[Link] JavaScript code when user click on button, it will display sum of even
numbers from 1 to 10.

<html>
<head>
<title>JS program to print sum of even numbers.</title>
<script>
function display_sum() {
var i, sum=0;

for(i=1;i<=10;i++)
{
if(i%2==0)
sum=sum+i;
}
[Link]("disp").innerHTML = "Sum of even numbers
from 1to10 - " + sum;
}
</script>
</head>

<body>
<input type="button" name="disp_sum" value="Display Sum"
onclick="display_sum()">

<br>
<p id="disp"> </p>

</body>
</html>

[Link] JavaScript code to print all odd numbers from 50 to 100.

<html>
<head>
<title>JS program </title>
</head>

<body>
<h1>JS program to print odd numbers from 50 to 100</h1>
<script>
var i;
[Link]("Odd Numbers from 50 to 100");
for(i=50;i<=100;i++)
{
if(i%2!=0)
[Link]("<br>"+i);
}

</script>
</body>
</html>

[Link] JavaScript code to print factorial of 7 on button click.

<html>
<head>
<title>JS program - factorial of number</title>
<script>
function display_factorial(num) {
var i, f = 1;
for (i = num; i >= 1; i--) {
f=f*i;
}
[Link]("disp").innerHTML = "Factorial of 7 - " + f;
}
</script>
</head>

<body>
<h1>JS program to print factorial of number</h1>
<input type="button" name="disp_fact" value="Display Factorial"
onclick="display_factorial(7)">

<br>
<p id="disp"> </p>

</body>
</html>

[Link] JavaScript code to print square of a accepted number.

<html>
<head>
<title>JS program to display square of a number</title>
</head>

<body>
<script>
var n, r;
n=parseInt(prompt("Enter a number:"));
r=n*n
alert("Square - " + r);
</script>
</body>
</html>

[Link] JavaScript code to count length of accepted string after click on the
button.
<html>
<head>
<title>JS program</title>
<script>
function display_length() {
var str, len;
str = form1.str_box.value;
len = [Link];
[Link]("disp").innerHTML = "Length of String - " +
len;
}
</script>
</head>

<body>
<h1>JS program to print length of string</h1>
<form name="form1">
<input type="text" name="str_box" size=50>
<input type="button" name="disp_strlen" value="Display Length"
onclick="display_length()">
</form>
<br>
<p id="disp"> </p>

</body>
</html>

[Link] JavaScript code to accept two dates and find the difference in those
dates.

<html>
<head>
<title>JS program</title>
<script>
function display_diff() {
var d1, d2, diff;
d1 = new Date([Link]);
d2 = new Date([Link]);
diff = (d2 - d1) / (1000 * 3600 * 24);
[Link]("disp").innerHTML = "Difference of dates in
days - " + diff;
}
</script>
</head>

<body>
<h1>JS program to display difference between dates</h1>
<form name="form1">
<input type="date" name="date1">
<br> <br>
<input type="date" name="date2">
<br> <br>
<input type="button" name="disp_diff" value="Display Difference"
onclick="display_diff()">
</form>
<br>
<p id="disp"> </p>
</body>
</html>

[Link] JavaScript code to take a input of string and reverse the string in
output.
<html>
<head>
<title>JS program - revverse of string</title>
<script>
function display_reverse(str) {
var newstr;
newstr = [Link]("").reverse().join("")
[Link]("Reverse of String - " + newstr);
}
</script>
</head>
<body>
<h1>JS program to reverse a string</h1>
<script>
var s;
s = prompt("Input a string");
display_reverse(s)
</script>
</body>
</html>

[Link] JavaScript code to input 3 digit number and find sum and product of
its digit of the number use onblur event for the program.

[Link] JavaScript code to print factorial of accepted number.


at February 15, 2024 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
HSC | Std. 12th IT online Exam March 2024 - Write HTML Programs
Complete List

HSC IT March - 2024 EXAM (Expected Questions) - 10 marks


- 5 marks (Science section)
- 10 marks (Commerce & Arts section)
1. Write a html program to accept Name of the College, Total number of
students in the college, Total number of halls (range till 100). The data should
be sent to the server. Watch Video

<!doctype html>
<html>
<head>
<title> College Data </title>
</head>
<body>
<h1> College Information Form</h1>
<form name="Clgform" method="post" action="[Link]">
Name of the College :
<input type="text" name="clg_name">
<br> <br>
Total No. of Students :
<input type="number" name="stud_no" min=1>
<br> <br>
Total No. of Halls :
<input type="range" name="hall_no" min=1 max=100>
<br> <br>
<input type="submit" value="SUBMIT">
<input type="reset" value="RESET">
</form>
</body>
</html>

2. Write a html program to accept Name of the Employee (cannot be blank),


Email Id of the Employee, Salary (maximum 50000). The data should be sent to
the server. Watch Video
<!doctype html>
<html>
<head>
<title> Employee Data </title>
</head>
<body>
<h1> Employee Information Form</h1>
<form name="empform" method="post" action="[Link]">
Name of the Employee :
<input type="text" name="emp_name" REQUIRED>
<br> <br>
Email ID :
<input type="email" name="emp_email" min=1>
<br> <br>
Salary :
<input type="number" name="emp_sal" min=1 max=50000>
<br> <br>
<input type="submit" value="SUBMIT">
<input type="reset" value="RESET">
</form>
</body>
</html>

3. Write a html program to create a form to accept Doctor's name, number of


patients (maximum 20), Date of examining patients. Watch Video
<!doctype html>
<html>
<head>
<title> Hospital Data </title>
</head>
<body>
<h1> Doctor Information Form</h1>
<form name="docform" method="post" action="[Link]">
Name of the Doctor :
<input type="text" name="doc_name" REQUIRED>
<br> <br>
No. of Patients :
<input type="number" name="patient_no" min=1 max=20>
<br> <br>
Date of Examination :
<input type="date" name="ex_date">
<br> <br>
<input type="submit" value="SUBMIT">
<input type="reset" value="RESET">
</form>
</body>
</html>

4. Write a html program to create a form to accept Patient's name, his mobile
number and date of birth. Keep all fields compulsory. <!doctype html>
<html>
<head>
<title> Hospital Data </title>
</head>
<body>
<h1> Patient Information Form</h1>
<form name="docform" method="post" action="[Link]">
Name of the Patient :
<input type="text" name="pat_name" REQUIRED>
<br> <br>
Mobile No. :
<input type="number" name="pat_mobile" REQUIRED>
<br> <br>
Date of Birth :
<input type="date" name="pat_date" REQUIRED>
<br> <br>
<input type="submit" value="SUBMIT">
<input type="reset" value="RESET">
</form>
</body>
</html>

5. Write a html program to create a form to accept student's name, number of


practicals he has completed and provide facility to upload his completion
certificate. Watch Video
<!doctype html>
<html>
<head>
<title> Student Data </title>
</head>
<body>
<h1> Student Practical Information Form</h1>
<form name="studform" method="post" action="[Link]">
Name of the Student :
<input type="text" name="stud_name" REQUIRED>
<br> <br>
No. of Practicals Completed :
<input type="number" name="practical_no" min=1>
<br> <br>
Upload Completion Certificate :
<input type="file" name="certificate">
<br> <br>
<input type="submit" value="SUBMIT">
<input type="reset" value="RESET">
</form>
</body>
</html>

6. Write a html program to create a form to accept students roll no (in number
format), Unit test marks (maximum 25 marks), Terminal exam marks
(maximum 50 marks). Include the name of the Subject teacher and send the
data to the server.
<!doctype html>
<html>
<head>
<title> Student Data </title>
</head>
<body>
<h1> Student Exam Marks Form</h1>
<form name="studform" method="post" action="[Link]">
Student Roll No :
<input type="number" name="stud_roll" min=1>
<br> <br>
Unit Test Marks :
<input type="number" name="unit_test" min=0 max=25>
<br> <br>
Terminal Exam Marks :
<input type="number" name="unit_test" min=0 max=50>
<br> <br>
Name of the Subject Teacher :
<input type="text" name="sub_teacher">
<br> <br>
<input type="submit" value="SUBMIT">
<input type="reset" value="RESET">
</form>
</body>
</html>

7. Write a html program to accept Student ID (combination of alphabets and


numbers), date of joining, College name, percentage in previous class (in
digits). The data should be sent to the server.
8. Write a html program to enter Travel Details as follows : Name of the Hotel,
Date of check-in, Number of members (compulsory field). The data should be
sent to server.

9. Write a html program to create registration form to accept name, mobile no.,
date of birth. The form should have register caption in the button to submit the
data.

<!doctype html>
<html>
<head>
<title> User Data </title>
</head>
<body>
<h1> User Registration Form</h1>
<form name="userform" method="post" action="[Link]">
Name of the User :
<input type="text" name="user_name">
<br> <br>
Mobile No. :
<input type="number" name="user_mobile">
<br> <br>
Date of Birth :
<input type="date" name="user_dob">
<br> <br>

<input type="submit" value="REGISTER">


<input type="reset" value="RESET">
</form>
</body>
</html>

10. Write a html program to create Registration Form to accept Name, Mobile
no (with pattern restriction) and Date of Birth. The form should have
REGISTER written on the button to submit the data.
11. Write html program to accept Name of the hospital, Email Id of the
hospital, Number of beds in the hospital. The data should be sent to the server.

<!doctype html>
<html>
<head>
<title> Hospital Data </title>
</head>
<body>
<h1> Hospital Information Form</h1>
<form name="hospitalform" method="post" action="[Link]">
Name of the Hospital :
<input type="text" name="hosp_name">
<br> <br>
Email Id. :
<input type="email" name="hosp_email">
<br> <br>
Number of beds in Hospital :
<input type="number" name="hosp_beds">
<br> <br>
<input type="submit" value="SUBMIT">
<input type="reset" value="RESET">
</form>
</body>
</html>
12. Write a html program to accept following information from the user. 1)
Name of the hospital 2) Email Id of the hospital 3) Number of beds in the
hospital 4) Nature of the Hospital (Private or Government). The data should be
sent to the server.

13. Write a html program to accept Email Id of the Hotel, Date of Foundation,
Number of tables in hotel. The data should be sent to the server.

14. Write html program to create a form to accept students roll no (in number
format), Unit test marks(maximum 25 marks), Terminal exam marks
(maximum 50 marks). Include the name of the Subject teacher and send the
data to the server.

<!doctype html>
<html>
<head>
<title> Student Data </title>
</head>
<body>
<h1> Student Exam Marks Form</h1>
<form name="studform" method="post" action="[Link]">
Student Roll No :
<input type="number" name="stud_roll" min=1>
<br> <br>
Unit Test Marks :
<input type="number" name="unit_test" min=0 max=25>
<br> <br>
Terminal Exam Marks :
<input type="number" name="unit_test" min=0 max=50>
<br> <br>
Name of the Subject Teacher :
<input type="text" name="sub_teacher">
<br> <br>
<input type="submit" value="SUBMIT">
<input type="reset" value="RESET">
</form>
</body>
</html>

15. Write html program to accept student name, Date of birth(compulsory field)
and attendance (in number form). Send the data to the server.
<!doctype html>
<html>
<head>
<title> Student Data </title>
</head>
<body>
<h1> Student Attendance Percentage </h1>
<form name="studform" method="post" action="[Link]">
Student Name :
<input type="text" name="stud_name">
<br> <br>
Date of Birth:
<input type="date" name="stud_dob" REQUIRED>
<br> <br>
Attendance Percentage :
<input type="number" name="stud_attd" min=0 max=100>
<br> <br>
<input type="submit" value="SUBMIT">
<input type="reset" value="RESET">
</form>
</body>
</html>

16. Write a html program to display "Digital India" in Verdana font using
internal CSS. Add any two sentences about Digital India below in orange
color. Watch Video

<!doctype html>
<html>
<head>
<title> Digital India </title>
<style>
h1 { font-family : "Verdana"; }
p { color : orange; }
</style>
</head>
<body>
<h1> Digital India</h1>
<p> Digital India is a campaign launched by the Government of India to
ensure that the Government's services are made available to citizens
electronically through improved online infrastructure and by increasing
Internet connectivity. </p>

<p> It making the country digitally empowered in the field of


technology. </p>
</body>
</html>

17. Write a html program to display "Digital India" having underline using
inline CSS. Add any two sentences about IT subject below having yellow color
background for the text.

18. Write a html program to display "Maharashtra State Board" in blue color
and font size 30 pixels using internal CSS. Give background colour yellow for
the web page.

<!doctype html>
<html>
<head>
<title> MS Board </title>
<style>
body { background-color : yellow; }
p{
color : blue;
font-size ; 30px;
}
</style>
</head>
<body>

<p> Maharashtra State Board</p>

</body>
</html>

19. Write a html program to display State Government of India in red color and
font size 30 pixels and align to the center. Give background color yellow for the
webpage. Use External CSS.

20. Write a html program to display Cyber Millennia having Arial font and
dotted border. Add any two advantages in blue color text. Use internal CSS to
achieve the same.
21. Write a html program to display "Maharashtra State Board" in font size 40
pixels using internal CSS. Give background colour yellow for the same text.

<!doctype html>
<html>
<head>
<title> MS Board </title>
<style>
body { background-color : yellow; }
p { font-size ; 40px; }
</style>
</head>
<body>

<p> Maharashtra State Board</p>

</body>
</html>

22. Write a html code to display Good Morning having bold effect and
underline. Also display Welcome to our page centrally in 30 pixel font size. Use
inline CSS to achieve the above.

23. Write a html program to display Ecommerce having Arial font using inline
CSS. Add an ordered list having any two advantages of it.

24. Write a html program to display "Web designing" in italic format and having
underline using internal CSS. Add any two sentences about web designing in
green color.

<!doctype html>
<html>
<head>
<title> Web Designing </title>
<style>
h1 {
font-style : italic;
text-decoraton : underline;
}
p { color : green; }
</style>
</head>
<body>
<h1> Web Designing</h1>
<p> Web designing is the art of planning and arranging content on a website
so that it can be shared and accessed online with the world. </p>

<p> Web design encompasses many different skills and disciplines in the
production and maintenance of websites. </p>

</body>
</html>

25. Write a html code to display scientist name Homi J Bhabha having text
color blue, underling the same and align it to the center of the page using
internal CSS.

26. Write a html program to display SAVE WATER SAVE EARTH in blue color
with dotted border and 30px font size. Add any two sentences about how to
save water in a paragraph in green color. Use internal CSS to achieve the same.

27. Write html program to display Information Technology in bold format and
Times New Roman font. Add any two sentences about IT subject below in
orange color. Use inline CSS.

28. Write html program to two paragraphs and display first paragraph should
have cyan background color and second should have yellow text color with blue
background color.

29. Write a html program to insert inline frame on web page. Use xyz html file
as a source for inline frame. Size of inline frame should be 100x100 pixels.

<!doctype html>
<html>
<head>
<title> Inline Frame example </title>
</head>
<body>
<h1> Inline Frame</h1>
<iframe src="[Link]" height=100 width=100>

</body>
</html>

30. Write html program to insert inline frame on web page. Use xyz html file as
a source for inline frame. Size of inline frame should be 300 x 300 pixels.
<!doctype html>
<html>
<head>
<title> Inline Frame example </title>
</head>
<body>
<h1> Inline Frame</h1>
<iframe src="[Link]" height=300 width=300>

</body>
</html>

31. Write a html program to create a list of 3 flowers in ordered list and list of 3
fruits in unordered list.

32. Write a html code to display a list of any 4 author names in ordered list
using relevant list tags (e.g. author P.L. Deshpande, Kusumagraj, Chetan
Bhagat) in roman numbering I, II, III ….

33. Write a html program to create an ordered list of Tea and Coffee and
unordered list under Coffee as Black Coffee and cold Coffee.

34. Write a html program to create an ordered list of Tea, Coffee and Milk and
unordered list under Milk as Turmeric Milk and Hot Chocolate.

35. Write a html program to create an ordered list of Waffles and Cake Shake
and add Orea and Salted Caramel in unordered listing under Cake Shake.

36. Write a html program to create an unordered list having names of two
students. Add in ordered list 2 subjects that they have selected in FYJC below
each of their names.

37. Write a html program to create an ordered list of 3 courses (FYBCom,


SYBCom, TYBCom) in Bhaktivedanta College and under each stream mention 3
subjects taught in Unordered listing.

38. Write a html program to create an ordered list of 3 cities and under each
city mention names of 3 banks in unordered list. Give heading as Metropolitan
Banks.

39. Write a html program to create an Ordered list having two streams
Commerce and Science. Under each stream enter 2 classes FYJC and SYJC in
Unordered listing.
40. Write html program to create an ordered list of 3 languages used for
speaking and unordered list having 2 computer languages. Watch Video

<!doctype html>
<html>
<head>
<title> Languages </title>
</head>
<body>
<h2> Languages used for Speaking</h2>
<OL>
<LI> English </LI>
<LI> Hindi </LI>
<LI> Marathi </LI>
</OL>
<h2> Computer Languages</h2>
<UL>
<LI> Java </LI>
<LI> Python </LI>
</UL>
</body>
</html>

41. Write html program to display names of two friends in ordered list and also
display their hobbies under their name in unordered list. Watch Video

<!doctype html>
<html>
<head>
<title> Friends and their Hobbies </title>
</head>
<body>
<h2> Friends and their Hobbies</h2>
<OL>
<LI> Vedika </LI>
<UL>
<LI> Singing </LI>
<LI> Dance </LI>
</UL>
<LI> Riya </LI>
<UL>
<LI> Reading Books </LI>
<LI> Travelling to Historical Places </LI>
</UL>
</OL>
</body>
</html>

42. Write html program to create an unordered list having names of two
students. Add ordered list of subjects they selected:

<!doctype html>
<html>
<head>
<title> Students subjects</title>
</head>
<body>
<h2> Student List with subjects</h2>
<UL>
<LI> Sanika</LI>
<OL>
<LI> IT</LI>
<LI> Maths</LI>
</OL>
<LI> Sachin</LI>
<OL>
<LI> English </LI>
<LI> PT </LI>
</OL>
</UL>

</body>
</html>

43. Write a html program to create nested list having names of two students.
Add ordered list of 3 subjects that they have selected under each name.

You might also like