VBScript Class - 8 by S P SHARMA CLASSES (7048972696)
<html>
<body>
<script type="text/VBScript">
document.write("<br/>...................</br></br>")
x=1
do
if x=5 then exit do
document.writeln(x & "<br>")
x=x+1
Loop while x<11
document.write("<br/>...................</br></br>")
x=1
do while x<11
if x=5 then exit do
document.writeln(x & "<br>")
x=x+1
Loop
document.write("<br/>...................</br></br>")
x=1
do until x>11
if x=5 then exit do
document.writeln(x & "<br>")
x=x+1
Loop
document.write("<br/>...................</br></br>")
x=1
while x<11
'if x=5 then exit do
document.writeln(x & "<br>")
x=x+1
wend
document.write("<br/>...................</br></br>")
dim emp(2)
emp(0)="Ram"
emp(1)=5
emp(2)=8.6
'emp(3)="Raj"
document.write("emp(0)=" & emp(0) & "<br/>")
document.write("emp(1)=" & emp(1) & "<br/>")
document.write("emp(2)=" & emp(2) & "<br/>")
document.write("<br/>...................</br></br>")
dim std(4)
std(0)="Ram"
std(1)="Raj"
std(2)="Sam"
std(3)="John"
std(4)="Amit"
for each x in std
document.write(x & "<br/>")
next
document.write("<br/>...................</br></br>")
call show()
sub show()
document.write("Hello from VBScript Sub Procedure<br/>")
end sub
call show()
call display()
function display()
document.write("Hello from VBScript Function<br/>")
end function
call display()
document.write("<br/>...................</br></br>")
sub show1(x)
document.write("x=" & x &"<br/>")
end sub
call show1(10)
function findarea(r)
const pi =3.14
area=pi*r*r
document.write("area=" & area &"<br/>")
end function
findarea(3)
call findarea(2)
document.write("<br/>...................</br></br>")
function findarea(r)
const pi =3.14
area=pi*r*r
findarea=area
end function
document.write("area=" & findarea(10) &"<br/>")
k=findarea(20)
document.write("area=" & k &"<br/>")
r1=inputbox("Enter the radius of circle")
k=findarea(r1)
document.write("area=" & k &"<br/>")
</script>
</body>
</html>
No comments:
Post a Comment