You are on page 1of 14

Program1 program1.

html -Notepad
File Edit Format View Help
C O File | C:/Users/nagabhushan/Desktop/program1.ntm<IDOCTYPE html>
<html>
<head>
Simple Caleulator <title> Program1</title
script type= "text/javascript"> function update(value){
35 document.getElementByld("display").value += value

function result){
document.getElementById("display"). value =eval(document.getElementById("display"). value):
23x
function reset(){ document. getElementById("display").value = ":

/script>
<head

<body
<hl> Simple Calculator </hl>
<formname="myForm">
<table border-2>

stdalign="center">
sinput type="text" id="display" ><br >
/td

<tr>
Std>
<input type="button" name="7" value" 7 " onclick="update(7)"/>

sinput type="button" name="8" value=" 8 " onclick="update(8)"/>

<input type="button" name"9" value=" 9 " onclick="update(9)


>
sinput type="button" name="+" value="+" onclick="update(+)"
br/
<input type="button" name="4" value=" 4 "onclick"update(4)">
i n p u t t y p e "button" name-"5" value=" 5 " onclick-"update(5)"/>

"
<input type="button" name="6" value=" 6 onclick="update(6)" />
c i n p u t type="button" name="." value=" - " onclick="update(-)"/>

Ln S2, Col 1 100% Windows (CRIA OT-8


Program2 + program2.html- Notepad
File Edit Format View Help
C File C/Users/nagabhushan/Desktop/program2.html <!DOCTYPE html>
html>
<head
Program to print the squares and cubes of the numbers stite progran2-chites
<head
NumberSquare|Cube <body>
| <hl>Program to print the squares and cubes of the numbers</h1>
<table alig="left" border "2">
<tr<th>Number<th><th>Square</th><th>Cube</th><tr>
SCript
for(var a=0; a<=10; a++) { document.write( "kt><td>" + a+ "</td><td>" +a*a + "</td><td>" +a*a'
j64
125 /script>
36 |216
49 343 /table>
64 s12 body>
html>
9 81
729
10 1001000

Ln 11, Col 45
p r o g r a m 3 . h t m l - Notepad
Program3
File Edit Format View Help
C OFile | C:/Users/nagabhushan/Desktop/program3.html <head
stitle>Program3</title>
<head>
Text-GroWing body>
sp id="txt"></p>
SCript>
var myVar = set+nterval(Growing, 100):

var my Varl
=
0;
var i=0;
function Growing() {
iitl;
document.body.style.fontSize = "5px";

document.getElementByld("txt").innerHTML Text-Growing:
document.body.style.fontSize=parseFlo (document.body.style.fontSize)+(i*1.0) + "px":
document.body.style.color-red:
if(document.body.style.fontSize-s0px) {
clearInterval(1my Var);
i=1
document.body.style.color blue;
my Varl = setlnterval(Shrinking, 100);

function Shrinking() {
document getElementByld("txr").innerHTML="Text-Shrinking:
document.body.style.fontSize=parseFloat(document.body.style.fontSize)-(i*1.0)+ "px":
ifdocument.body.style.fontSize"5px") {
clearInterval(my Var l1)
myVar set+nterval(Growing. 100);:

Iscript
/body>
<htm>

Ln 11, Col15 100% Windows (CRLF) UTF-8


Program3 program3.html- Notepad
File Edit Format View Help
C O File|C/Users/nagabhushan/Desktop/program3.htmi <head>
stitle>Program3</title>
<head>
Text-Shrinking <body
<p id="txt"></p>
<SCIip
var myVar = setinterval(Growing. 100):

var my Varl 0;
=

var i-0
function Growing0 {
iitl;
document.body.style.fontSize = "5px":

document.getElementByld("txt").innerHTMI Text-Growing':
document.body.style.fontSize-parseFloat(document.body.style.fontsize)+(i*1.0) + "px":
document.body.style.color red;
ifdocument.body.style.fontSize=50px){
clearInterval(myVar);
i=1;
document.body.style.color-blue
myVarl =setlnterval(Shrinking, 100):

function Shrinking() {
document.getElementByld("txt").innerHTML"Text-Shrinking;
document.body.style.fontSize parseFloat(document.body.style.fontSize)- (i*1.0)+ "px":
ifdocument.body.style.fontSize="Spx") {
clearInterval(myVarl)
myvar = setlnterval(Growing, 100)

/script>
body>
</htnl>

Ln 11, Cols 100% Windows (CRLA) UTF-8


X
Program 4A

C OFile | C/Users/nagabhushan/Desktop/program4a.html

This page says


Displaying Leftmost Vowel Position of the left most vowel is 2

Enter the text OK

vemana it

program4a.html - Notepad X
Click here
File Edit Format View Help
<IDOCTYPE html>
<html>
<head>
<title>Program 4A</title>
<SCTipt>
function vow(st) {
var pos;
pos =st.search(/ [aeiouAEIOU]/:
if(pos<0)
alert("patfterm not foundn");
else
alert("Position of the left most vowel is "+(post1);

/script
head>
<body
<hl>Displaying Lefmost Vowel<h1>
<fom>
sp>Enter the text</p>
<input type="text" id="voweltext" ><br/><br/
input type="button" value-="Click here" onclick="vow(voweltext.value):" >
</form>
<body>
<html>
Ln 7, Col S 100% Windows (CRLF UTF-E
program4b.html -Notepad
File Edit Format View Help
Program4b +

<IDOCTYPE html> C
<html>
File| C/Users/nagabhushan/Desktop/program4b.html
SHAREit Free Dow. (43 unread) - nagas..
<head>
title>Program4b</title>
SScript Reversing Number
finction rev(nl) {
n= parseInt(n1):
Enter a Number
if ( !isNaN(n))
16657 Reverse
var temp=0,rev = 0;
while n >0){
temp =1%10; program4b.html X +
rev = rev*10+temp;
C O File C/Users/nagabhushan/Desktop/program4b.html
n=n/10,
D-parselnt(n): The Reverse number is:75661

document.write("The Reverse number is:", rev);

else
alert("Invalid input"):

/script>
</head>
<body
<h2>Reversing Number</h2>
<fom>
p>Enter a Number</p>

Sinput type="text" name="num" >


sinput type="button" value-"Reverse" onclick="rev(num.value)"
/form>
</body>
html>
vtu.xml Notepad

CAUsers\nagabhushan\Desktop\vtuxml C Search.. P u File Edit Format View


<?xml version =
Help
"1.0" encoding= "utf-8"?>
CAUsers\nagabhushan\Des.. X

<?xml-stylesheet type="text/css" href= "prg5.css" ?>


VTUStudent Information - prg5.xml ->
Svtu
<hl> VTU Student Information </h1>

USN: 1VI09CSO55 <student>


Name:Suma <uSn> Span>USN: /span> 1VI09CSO55 Ausn>
College:VIT <name> <span>Name:</span>Suma </name>
Branch:CSE Scollege><span> College:</span>VIT Icollege>
YOJ:2009 branch><span>Branch /span>CSE </branch>
email: suma@yahoo.com yoj span YOJ:</span>2009 lyoj>
Kemail> <span> email: </span>suma@yahoo.com<lemail>
</student>

USN: 1VI09CSO5S5 Sstudent

Name:Suma Susn> span>USN: </span> 1VI09CS055 <hisn>


College:VIT <name> <span>Name:</span>Suma /name

Branch:CSE Scollege>Kspan> College:</span>VIT </college>


<branch><span>Branch :</span>cSE </branch>
YOJ:2009 yoj> span>YOJ :</span>2009 /yoj>
email: suma@yahoo.com email> span> email: </span>suma@yahoo.comlemail>

</student
USN: 1VI09CSO55
<student>
Name:Suma <usn span>USN: </span> 1VIO9CSO55 <husn>
College:VIT name> span>Name:/span>Suma S/name>
Branch:CSE Kcollege><span> College:/span>VIT <lcollege>
YOJ:2009 branch><span>Branch </span>CSE </branch>
email: suma@yahoo.com syoj Kspan> YOJ :</span>2009 <lyoj
----------------=------ email> <span> email: </span>suma@yahoo.com/email>
/student>

vtu>

Ln 1, Col 1 100% Windows (CRLA


program6,php - Notepad

3localhost/program6.php +
File Edit Format View Help

localhost/program6.php ?php
Stile ="count.txt;
You are visitor number:3

Scount= strval(file_get_contents(Sfile));
file_put_contents($file.(int)(Scount) + 1);
echo("You are visitor number:".Scount);

Ln 9, Col 1 100% Windows (CRL UTF-8


lab7.php -Notepad
Digital Clock File Edit Format View Help
C O localhost/lab7.php KIDOCTYPE html>
html>
<head
Digital Clock <title>Digital Clock</title>
head
The time from the server is 01:55:52pm <body>
<hl> Digital Clock </hl>
|<h3>
php
echo "The time from the server is ". date("hisa");
header("Refresh: 1; ur=-lab7.php");
h3>
</body>
html>

Ln 1, Col 1 100% Windows (CRLF) UTF-8


l a b 8 - 1 . p h p - Notepad
simplecalculator +
File Edit Format View Help
C localhost/lab8-1.php <!DOCTYPE html>
<html>
Simple Calculator <head
<title>simple calculator</title>
head
Enter Number: | 8
body>
Enter Number2: |9
<?php
iffisset(S POST[opr)) {
Result: 17 Stxtl-$ POST[nl]:
Stxt2-S POST[12]:
Soprnd-S POST[opr]
if(Soprnd="+")
Sres=Stxtl +8
if(Soprnd="-")
Sres-Stxtl Stxt2;
if(Soprnd="x")
Sres=Stxtl * Stxt2:

if(Soprnd="/")
Sres=Stxt l / Stxt2;

<h3> Simple Calculator </h3><br >


<fom method-="post" action="lab8-1.php">
Enter Number:
<inputtype="number" name="nl" value-"<?php echo Stxtl;?>">
<br ><br>
Enter Number2:
input type="number" name="n2" value="<?php echo Stxt2; ?>" />
<br ><br >

Result
<inputtype="number" name="res" value="<?php echo Sres; ?>"
<br><br >
Ln 8, Col 28 100% Windows (CRLA UTF-8
lab8-2.php - Notepad X
Clocalhost/lab8-2.php
File Edit Format View Help
C localhost/lab8-2.php
k?php
Smatrix = aray(
The input matrix is:4 12
634 array(4, 1, 2).
array(6, 3, 4)

Transpose Matrix SrowCount=count(Smatrix):


46
| ScolCount=count(Smatrix[0]):
echo "The input matrix is:<bri>":
24
for(Sr 0; Sr < SrowCount, Srt+)
{ for(Sc=0; Sc < ScolCount; Sct+)

echo Smatrix[Sr][sc]."t":
echo "<br \";

echo "<br ><br >Transpose Matrix <br />"


for(Sr = 0; Sr < ScolCount; Sr++)

{for(Sc=0; Sc <SrowCount; Sc++)

echo Smatrix[Sc][Sr]."\r:

echo "<br>":

Ln 1, Col 1 100% Windows (CRLA UTF-8


lab8-3.php - Notepad
localhost/lab8-3.php
File Edit Format View Help
C localhost/lab8-3.php echo "The input matrix A is:<br>";
for(Sr = 0; Sr <2: Sr++)
The input matrix A is:1 2
4
for(Sc-0; Sc < 2: Sct+){
echo Sa[Sr][Sc]."r";
The input matrix B is:
echo "<br |>"

echo "<br> The input matrix B is:<br \>":


Matrix multiplication AxB: for(Sr = 0: Sr < 2: Sr++){
99 for(Sc=0, Sc <2;Sc++) {
echo Sb[Sr][Sc]."e":
echo "<br \>":

Sres = Array():

for(Si-0; Si<2; Si++){


for(Si-0: Sj2Sj++) {
Sres[$i [Sj]=0;
for(Sk-0;Sk<2:5k++) {
Sres[Sill$j]-Sres[Si][$j]+(Sa[si][Sk]*Sb[Sk][Si]);

echo "<br ><br > Matrix multiplication A xB :<br/>";

for(Sr= 0: Sr < 2: Sr++){


For(Sc=0; Sc < 2: Sct+)
echo Sres[Sr][Sc]."r":
echo "<br";

Ln 33, Col 1 100% Windows (CRLF)


UTF-8
E3localhost/lab8-4.php
lab8-4.php- Notepad X
C Olocalhost/lab8-4.php File Edit Format View Help

The input matrix A isS: <?php


Sa=Array(Array(1,2).Array(4.5):
45 Sb =Array(Aray(1.2).Array(2.7));
The input matrix B is: echo "The input matrix A is:<br";
2
for(Sr=0; Sr <2; Srt+){
27
for(Sc=0; Sc <2:Sc++)D{
Addition of matrices A+ B is: echosa[Sr][Sc]."r";
echo "<br >"

echo "<br > The input matrixB is:<br " ;


for(Sr = 0; Sr <2; Sr++) {

for(Sc=0: Sc <2; Sc++) {


echo Sb[Sr][Sc]."\t":

echo "<br " ;

echo "<br Addition ofmatrices A+B is:<br \>";


|for(Si=0; Si<2; Si++) {
for(Si-0; Sj<2; Sj++) {
echo Sa[Si]ISj]+Sb[si][Sj]."r";
echo "<br D";

Ln 21, Col 1 100% Windows (CRLF UTF-8


program9.php - Notepad
E3 localhost/program9.php +
File Edit Format View Help
C
localhost/program9.phpphp
The extracted states are as follows: Sstates "Mississippi Alabama Texas Massachusetts Kansas"
SstatesArray=:
statesArray[0]=Texas Sstates1=explode( ',$states)
statesArrayl]= Kansas
statesArray[2]= Massachusetts foreach(Sstates1 as Sstate) {
statesArray[3] = Alabama
if(preg_match( xasS/. (Sstate)))

SstatesArray[0]=(Sstate),

foreach($states1 as $state) {
ifpreg_match(k.*sS/i". (Sstate)))
SstatesArray[]] = (Sstate);

foreach(Sstates1 as Sstate) {
ifpreg_match(/"M. "sS/'. (Sstate))
SstatesArray[2] = (Sstate);

foreach(Sstates1 as Sstate) {
if(pregmatch(/aS/. (Sstate))
SstatesArray[3] = (Sstate):

echo "The extracted states are as follows: <<br ><br " :


foreach( SstatesArray as Selement => Svalue ){

print( "'statesArray[Selement) =
Svalue <br >"):

Ln 28, Col 1 100% Windows (CRLA UTF-8

You might also like