Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
<!DOCTYPE HTML>
<HTML>
<HEAD><TITLE>FORMATTING TAGS</TITLE></HEAD>
<BODY>
this is <b>bold</b>text<br/>
this is <i>italics</i>text</br>
use of subscript:H<sub>2</sub><br/>
use of superscript:X<sup>2</sup><br/>
area of a rectangle=<var>l</var>*<var>b</var><br/>
<cite>reverse string:</cite>
</body>
</html>
Practical 1 B
Block level formatting tags
<!DOCTYPE HTML>
<HTML>
<HEAD><TITLE>BLOCL LEVEL FORMATTING TAGS</TITLE></HEAD>
<BODY>
<H1>WELCOME TO HTML WEBPAGE</H1><BR/>
<H2>WELCOME TO HTML WEBPAGE</H2><BR/>
<H3>WELCOME TO HTML WEBPAGE</H3><BR/>
<H4>WELCOME TO HTML WEBPAGE</H4><BR/>
<H5>WELCOME TO HTML WEBPAGE</H5><BR/>
<H6>WELCOME TO HTML WEBPAGE</H6><BR/>
<H6>STAR PYRAMID:</H6>
<PRE>
*
* *
* * *
* * *
* * * *
</PRE>
<HR HEIGHT="3" WIDTH="90%" COLOR="RED"/>
<H5>C++ CODE TO PRINT TEXT:</H5>
<CODE>
#include<iostream.h><BR/>
void main()<BR/>
{<BR/>
Cout<<"welcome to html:";<BR/>
getch();<BR/>
}<BR/>
</code>
<h6>OUTPUT OF THE ABOVE CODE</h6>
<samp>welcome to html:</samp>
<hr color="rgb(0,0,255)/>
<h6> following sentences shows the use of blockquote</h6>
<blockquote>HTML stands for hypertext markup language .<head> tag
is the first member for the html family.
it is use to make webpages.</blockquote>
<font color="red" size="20" face="arial">
this is text with red colour with a size of 20 and font style arial.</font>
<h6>ADDRESS OF COLLEGE:</h6>
<address>G.SARAF;<BR/>
SUNDERNAGAR,<BR/>S.V.ROAD,<BR/>
MALAD(WEST)</address>
<abbr title="account=">A/C</abbr>is an abbreviation of
word<b>account</b><BR/>
<acronym title="American Standard Code for Information
interchange<BR/>
ASCII</acronym> is an acronym for American Standard Code for
Information interchange.<BR/>
<p>HTML stands for hypertext markup language .<head> tag is the first
member for the html family.
it is use to make webpages.</p><BR/>
<p align="center">HTML stands for hypertext markup language .<head>
tag is the first member for the html family.
it is use to make webpages.</p><BR/>
<p align="right">HTML stands for hypertext markup language .<head>
tag is the first member for the html family.
it is use to make webpages.</p><BR/>
<p align="left">HTML stands for hypertext markup language .<head>
tag is the first member for the html family.
it is use to make webpages.</p><BR/>
<p align="justify">HTML stands for hypertext markup language .<head>
tag is the first member for the html family.
it is use to make webpages.</p><BR/>
FOR ANY QUERY,YOU CANCONTACT US AT
</address>info@saraf college.org</address></body>
</html>
Practical 1 C
List tags
<!DOCTYPE HTML>
<html>
<head><title>LISTS TAGS</title></head>
<body bgcolor="yellow">
<center><h1><u><font face="gabriola" color="golden">DESSERT MENU
LIST</font>
</u></h1></center>
<font face="lucida calligraphy">
<ol type="I">
<li>cake</li>
<ul type="disc">
<li>chocolate banana cake</li>
<li>basic vanilla cake</li>
<li>Italian lemon cake</li>
<li>cassove cake</li>
</ul>
<li>Ice-cream</li>
<ul type="circle">
<li>chocolate malt Ice-cream</li>
<li>maxican "fried"ice cream</li>
<li>salted caramel</li>
</ul>
<li>JUICE</li>
<ul type="square">
<li>mango juice</li>
<li>orange juice</li>
<li>mix fruit juice</li>
</ul>
</ol>
<dl>
<dt>CAKE</dt>
<dd>cake is a form of sweet dessert that is typically baked.in this oldest
form of cake cover a wide range of preparation that can be a simple
cake or alobrate,and that share features with order dessert,such as
pastries ,meringues,custard and pies</dd>
<dt>ICE CREAM</dt>
<dd>Ice cream is sweetened frozen food typically eaten as a dessert.it
is usually made from milk and cream and often combines with fruits
and other ingredients and flavour.it is typically sweetened with sugar
and sugar substitutes.</dd>
<dt>JUICE</dt>
<dd>Juice is a beverage made from the the extraction or pressing out
the natural liquid contained in fruits and vegetables. it can also refer to
liquids that are flavoured with these or other biological food
sources.juices is commonly consumed as a beverage or used as an
ingredientor flavouringin foods or other beverges</dd></font>
</body>
</html>
Practical 1 D
Web navigation- creating of website
<!DOCTYPE HTML>
<head>
<title> journey</title></head>
<body>
<h1>welcome dear</h1>
<a href="Mumbai.html" target="_blank">
Mumbai</a>
<a href="Delhi.html" target="_self">
Delhi</a>
<a href="Kolkata.html" target="_parent">
Kolkata</a>
<a href="Chennai.html" target="_self">
Chennai</a>
</body>
</html>
mumbai.html
<!DOCTYPE HTML>
<head>
<title> journey</title></head>
<body>
<h1>WELCOME TO MUMBAI</h1>
<center>
<a href="p1d.html">back</a>
</center>
</body>
</html>
delhi.html
<!DOCTYPE HTML>
<head>
<title> journey</title></head>
<body>
<h1>WELCOME TO DELHI</h1>
<center>
<a href="p1d.html">back</a>
</center>
</body>
</html>
kolkata.html
<!DOCTYPE HTML>
<head>
<title> journey</title></head>
<body>
<h1>WELCOME TO KOLKATA</h1>
<center>
<a href="p1d.html">back</a>
</center>
</body>
</html>
chennai.html
<!DOCTYPE HTML>
<head>
<title> journey</title></head>
<body>
<h1>WELCOME TO CHENNAI</h1>
<center>
<a href="p1d.html">back</a>
</center>
</body>
</html>
Practical 1 E
Inline style sheet
<DOCTYPE HTML>
<html>
<head>
<title>inline stylesheet</title></head>
<body>
<font style="color:blue;font-size:18px;text-decoration:underline;font-
family:arial;">
HELLO WORLD!</font>
<p style="color:green;font-size:22px;font-family:courier new;text-
weight:bold;text-indent:20px;margin:15px;align:left">
you said the other day ,you thought we were deal happier,king children
for they were fightning and frieghten inspite of their money.</p>
</body></html>
Practical 1 F
Internal style sheet
<!DOCTYPE HTML>
<html>
<head><title>internal style sheet</title>
<style type="text/css">
body{background-color:lemon;color:green;}
h1{text-align:center;font-size:3-px;font-family:arial;text-indent:10px;}
h3{color:#800000;left-margin:25px;background-color:yellow;}
ul.one{font-family:algerian;font-size:20px;color:red;}
ul.two{font-family:times new roman;font-size:22px;color:blue;}
</style>
</head>
<body>
<h1>INTERNAL STYLE SHEET DEMONSTRATION</h1>
<h3>LIST OF PROGRAMMING LANGUAGES</h3>
<ul type="disc" class="one">
<li>HTML</li>
<li>JAVASCRIPT</li>
<li>php</li></ul>
<ul type="square" class="two">
<li>c</li>
<li>c++</li>
<li>python</li>
</ul></body></html>
Practical 2 A
Different table
<!DOCTYPE HTML>
<html>
<head>
<title>TABLE</title></head>
<body>
<table border="1" cellpadding="1" height="2" widht="2"
align="center">
<tr>
<th rowspan="3" align="center" valign="middle">DAY</th>
</tr>
<tr>
<th colspan="2" >SCHEDULE</th>
<th rowspan="2">TOPIC</th>
</tr>
<tr>
<th>BEGIN</th>
<th>END</th>
</tr>
<tr>
<th rowspan="2">MONDAY</th>
<td rowspan="2">8:00am</th>
<td rowspan="2">5:00pm</th>
</tr>
<tr>
<td>VALIDITY OTD & RELAX MG</td>
</tr>
<tr>
<th rowspan="3" align="center">TUESDAY</th>
<td >8:00am</th>
<td >10:00am</th>
<td rowspan="2" >X PATH</td></tr>
<tr><td>10:00am</td>
<td>2:00pm</td>
</tr>
<tr>
<td>2:00pm</td>
<td>5:00pm</td>
<td>X SL TRANSFORMATION</td>
</tr>
<tr>
<th>WEDNESDAY</th>
<td >8:00am</th>
<td >2:00pm</th>
<td>X SL FORMATTING</td>
</tr>
</table>
</body>
</html>
Practical 2 B
Image mapping
Source Code:
<!doctype html><html>
<head>
<title>Image Mapping</title>
</head>
<body>
<h3><u><b><center>Image Mapping</center></b></u></h3>
<center><img src="1.jpg" width="800" height="400" alt="sky"
usemap="#abc"></center>
<map name="abc">
<area shape="circle" coords="634,131,53" alt="Mumbai"
href="mumbai.html">
<area shape="rect" coords="320,164,69,44" alt="Delhi"
href="delhi.html">
<area shape="poly" coords="500,406,377,275,377,407" alt="Chennai"
href="chennai.html">
</map>
</body></html>
Practical 2 C
Form contents
<!DOCTYPE HTML>
<html>
<head>
<title>CUSTOMER INFORMATION</title></head>
<body bgcolor="red">
<font color="black">
<table border="0" align="center" cellpadding="1">
<form>
<tr>
<td colspan="2">
<h1 align="center" ><u>CUSTOMER INFORMATION</u></h1>
</td></tr>
<tr>
<td>CUSTOMER ID:</td>
<td><input type="number" size="20" maxlength="15"></td>
</tr>
<br>
<tr>
<td>CUSTOMER NAME:</td>
<td><input type="text" size="20" maxlength="20"></td>
</tr>
<br>
<tr>
<td>ADDRESS:</td>
<td><textarea name="t1" rows="4" cols="30"></textarea></td>
</tr>
<br>
<tr>
<td>GENDER:</td>
<td><input type="radio" name="gender" value="female"
checked="checked">FEMALE
<input type="radio" name="gender" value="male" >MALE</td>
</tr>
<br>
<tr>
<td>CONTACT NUMBER:</td>
<td><input type="number" size="20" maxlength="12"></td>
</tr>
<br>
<tr>
<td>PRODUCT BROUGHT:</td>
<td><input type="checkbox" name="i1" value="shirts">SHIRTS
<input type="checkbox" name="i2" value="T-shirts">T-SHIRTS
<input type="checkbox" name="i3" value="jeans">JEANS
</td>
</tr>
<br>
<tr>
<td>SIZE:</td>
<td><select name="size">
<option value="s">S</option>
<option value="m">M</option>
<option value="l">L</option>
<option value="xl">XL</option>
</select>
</td>
</tr>
<br>
<tr>
<td>COLOUR:</td>
<td><input type="color" name="fav color"></td>
</tr>
<br>
<tr>
<td>DATE:</td>
<td><input type="DATE" ></td>
</tr>
<br>
<tr>
<td><input type="SUBMIT" value="SUBMIT">
           
<input type="reset" value="CLEAR">
</td>
</tr>
<br>
</form>
</table></font></body></html>
Practical 2 D
Multimedia feature
<!doctype html>
<html>
<head>
<title></title>
<body><center>
<h1>Welcome to Multimedia Features</h1>
<br>
<br>
<h3>Video with Video and Source tags</h3>
<video controls height="400" width="400" autoplay>
<source src="Shaun the Sheep The Movie – Official Trailer.mp4"
type="video/mp4">
</video><br>
<h3>Video with Embed tags</h3>
<embed src="Shaun the Sheep The Movie – Official Trailer.mp4"
height="400" width="400" autostart="true"><br><br>
<h3>Audio with Audio and Source tags</h3>
<audio controls height="400" width="400" autoplay>
<source src="Shaun the Sheep The Movie – Official Trailer.mp3"
type="audio/mp3">
</audio><br>
<h3>Audio with Embed tags</h3>
<embed src="Shaun the Sheep The Movie – Official Trailer.mp3"
height="400" width="400" autostart="true"><br>
</center>
</body></html>
Practical 2 E
Semantic tags
<!doctype html>
<html><head>
<title>Semantic Tags</title>
</head><body>
<section> <h1>WWF</h1>
<section>
<p> The Panda has become the symbol of WWF. The well known panda
originated from the panda named Chee Chee, that was transferred from
the Beijing Zoo to the London Zoo in the same year of the establishment
of WWF.</p>
</section>
</section><hr>
<article>
<nav><a href="a.html">HTML</a>
<a href="b.html">CSS</a>
<a href="c.html>Javascript</a>
<a href="d.html">Php</a>
</nav>
<header>
<p>WWF's Mission</p>
</header>
<footer>
</footer>
</article>
<hr>
<hr>
<figure>
<h4>Epcot Center</h4>
</article>
</figure><hr>
<main>
<h1>Web browsers</h1>
</article>
<h1>Google Chrome</h1>
<h1>Internet Explorer</h1>
</article>
<article>
<h1>Mozilla Firefox</h1>
</article>
</main><hr>
<detail>
<summary>Copyright 1999-2018</summary>
</details></body></html>
Practical 3 A
Factorial / Fibonacci
<!doctype html><html>
<head><title>factorial/Fibonacci series</title></head>
<body>
<script type="text/javascript">
document.write("-------Factorial-------"+" "+" "+" "
+" "+" "+" ");document.write("-------Fibonacci series--
-----"+"<br>");
for(i=1;i<=5;i++)
fact=fact*i;}
document.write("Factorial of 5 is "+fact+" "+" "
+" "+" "+" "+" ");
document.write(a+"\t");
document.write(b+"\t");
for(i=1;i<=8;i++){
c=a+b;
document.write(c+"\t");
a=b;
b=c;}</script></body></html>
Practical 3 B
Validation of controls
<!doctype html><html>
<head><title>Registration form</title>
<script type="text/javascript">
function validate()
var fname=document.f1.txtfname.value;
var email=document.f1.txtemail.value;
var mob=document.f1.txtmob.value;
var country=document.f1.optcountry.value;
if(fname==" ")
document.f1.txtfname.focus();
result;
else
for(i=0;i<fname.length;i++)
{
al=fname.substring(i,i+1);
if((al>="A"&&al<="Z''')||(al>="a"&&al<="z"));
else
document.f1.txtfname.value=" ";
document.f1.txtfname.focus();
return;
if(email==" ")
document.f1.txtemail.value=" ";
document.f1.txtemail.focus();
return false;}
else{
pos1=email.indexOf("@");
pos2=email.lastindexOf(".");
if(!(pos1>0&&pos2>pos1+1)){
alert("Invalid email");
document.f1.txtemail.value=" ";
document.f1.txtemail.focus();
return;}
if(mob==""||isNaN(mob)||mob.length!=10){
document.f1.txtmob.value=" ";
document.f1.txtmob.focus();
return;}
if(country==-1){
return;}
else{
return true;}}
</script>
</head>
<option value=1>India</option>
<option value=2>USA</option>
<option value=3>UK</option>
</select>
</fieldset>
</form>
</body>
</html>
Practical 3 C
Prime numbers
<!doctype html><html>
<head>
<title>Prime numbers</title>
</head>
<script>
function printPrime(){
var i = 0;
var j = 0;
c = 0;
if (i % j == 0) {
c++;
if (c == 2) {
document.getElementById("result").insertAdjacentHTML('beforeend',i +
'<br>');
Roll No:21
</script>
</head>
<body>
<div id="result"></div>
</body>
</html>
Practical 3 D
Sum of Digit of no.
<html>
<script type="text/javascript">
function sum()
var n1=parseInt(document.form1.n1.value);
var sum=0;
var a=0;
while(n1>0)
a=parseInt(n1%10);
sum=parseInt(sum+a);
n1=parseInt(n1/10);
alert("sum of digit="+sum);
document.write("sum of digit="+sum);
</script>
</head>
<body>
<br/>
</body>
</html>
Practical 3 E
Simple calculator
<html>
<head>
<body>
<script type="text/javascript">
function add()
var n1=parseInt(f1.t1.value);
var n2=parseInt(f1.t2.value);
var ad=n1+n2;
alert("value"+ad);
function sub()
var n1=parseInt(f1.t1.value);
var n2=parseInt(f1.t2.value);
var sb=n1-n2;
alert("value"+sb);
}
function mul()
var n1=parseInt(f1.t1.value);
var n2=parseInt(f1.t2.value);
var ml=n1*n2;
alert("value"+ml);
function div()
var n1=parseInt(f1.t1.value);
var n2=parseInt(f1.t2.value);
var dv=n1/n2;
alert("value"+dv);
function mod()
var n1=parseInt(f1.t1.value);
var n2=parseInt(f1.t2.value);
var md=n1%n2;
alert("value"+md);
</script>
</form>
</body>
</html>
Practical 4 A (IF)
If statements
<html>
<head>
<title><h1>conditional statement</h1></title>
</head>
<body>
<script type="text/javascript">
var i=67;
if(i>40)
document.write("congrats!!passed");
</script>
</body>
</html>
Practical 4 A (IF ELSE)
If Else statements
<html>
<head>
<title>conditional statement</title>
</head>
<body>
<script type="text/javascript">
var marks=70;
if(marks>40)
document.write("congrats!! passed");
else
document.write("fail");
</script>
</body>
</html>
Practical 4 A (switch)
Switch statements
<html>
<head>
<title>good</title>
</head>
<body>
<script type="text/javascript">
switch(no)
case 1:
document.write("good morning");
break;
case 2:
document.write("good afternoon");
break;
case 3:
document.write("good evening");
break;
default:
document.write("good night");
break;
</script>
</body>
</html>
Practical 4 B (For loop)
<!doctype html><html>
<head><title></title>
<script type="text/javascript">
function f()
var flag=0;
for(var i=2;i<n;i++){
if(n%i==0){
flag=1;
break;}}
if(flag==0){
else{
</script></head>
<body><form>
Source Code:
<!doctype html><html>
<head><title></title>
<script type="text/javascript">
function f(){
while(n1>0){
d=n1%10;
rev=rev*10+d;
n1=n1/10;}
if(n==rev){
Source Code:
<!doctype html><html>
<head><title></title>
</head>
<body>
<script type="text/javascript">
var i=1;
do{
document.write(i+"<br>");
i++;}
while(i<=10)
</script>
</body>
</html>
Practical 4 C
Java script
Source Code:
<!doctype html>
<html>
<head>
<title></title>
<script type="text/javascript">
book.subject="perl";
var fruits=["apple","banana","mango","orange"];
var pi_val=Math.PI;
var sin_val=Math.sin(30);
</script>
</head>
<body>
<script type="text/javascript">
document.write("String object:"+"<br>");
document.write(answer1+"<br>");
document.write(answer2+"<br>");
document.write(answer3+"<br>"+"<br>");
document.write("Object Consructor:"+"<br>");
document.write("book.name:"+book.subject+"<br>"+"<br>");
document.write("Array object:"+"<br>");
document.write("fruits name:"+fruits+"<br>"+"<br>");
Roll No:21
document.write("Date object:"+"<br>");
document.write("Date:"+date+"<br>"+"<br>");
document.write("Math object:"+"<br>");
document.write("PI:"+pi_val+"<br>");
document.write("Sin:"+sin_val+"<br>"+"<br>");
document.write("RegExp object:"+"<br>");
document.write("Number object:"+"<br>");
document.write("Number:"+num+"<br>"+"<br>");
document.write("Boolean object:"+"<br>");
document.write("Boolean:"+bool+"<br>");
</script> </body></html>
Practical 5 A
factorial
<html>
<head>
<title>factorial</title></head>
<body>
<h1>factorial</h1>
<?php
$n=$_POST['fac'];
$f=1;
for($i=1;$i<=$n;$i++)
{ $f=$f*$i; }
?>
</body>
</html>
Practical 5 B
Checking Prime number
<html>
<head><title>Prime number</title>
</head>
<body>
<?php
$p=$_GET["pr"];
$flag=0;
for($i=2;$i<$p;$i++)
{ if($p%$i==0)
{ $flag=1;
break; }
if($flag==0)
{echo"Number is prime";}
else
<html>
<head><title>greatest number</title>
</head>
<body>
<?php
$g=$_GET["gr"];
$c=$_GET["cr"];
if($g>$c)
else
?>
</body>
</html>
Practical 6 B
Binary pyramid
<html>
<head>pyramid<head>
<body>
<?php
$a=8;
for($i=1;$i<=5;$i++)
{for($j=1;$j<$i;$j++)
{if($a%2==0)
{echo "1";}
else
{echo "0";}
$a++;
} echo "<br>";
?>
</body>
</html>
Practical 7 A
string functions
<html>
<head><title>string functions</title>
</head>
<body>
<?php
?>
</body></html>
Practical 7 B
<html>
<?php
$price=array("mouse"=>320,"monitor"=>2000,"keyboard"=>1400);
?>
</body>
</html>
Practical 8 A (php)
<?php
$con=mysql_connect("localhost","root","");
if(!$con)
{
die("Could Not Connect".mysql_error());
}
if(mysql_query("Create Database College",$con))
{
echo "Database Created";
}
else
{
echo "Error Creating Database".mysql_error();
}
mysql_select_db("College",$con);
$sql="CREATE TABLE Department(E_name varchar(50),D_no
int,No_of_faculties int )";
mysql_query("$sql",$con);
mysql_close($con);
?>
<?php $con=mysql_connect("localhost","root","");
if(!$con)
{
die("Could Not Connect".mysql_error());
}
mysql_select_db("College",$con);
mysql_query("Insert into Department values(‘jayesh','10','22')");
mysql_query("Insert into Department values('zaid','20','24')");
mysql_close($con);
?>