Friday, 13 September 2013

Write a VB Script program to print a pyramid of Computer

index.html
-------------------

<html>
<head>
<title>VB Script By Asif</title>
<script language="VBScript">
Sub asif
str=Array("C","O","M","P","U","T","E","R")
Dim i,j
for i=0 to 7
for j=0 to i
document.write(str(j))
next
document.write("<br/>")
next
End Sub
</Script>
</head>
<body>
<form name="Form1">
<input type="button" name="Button1" value="Print"/>
<script for="Button1" event="onClick" language="VBScript">
Call asif
</script>
</form>

</body>
</html>
Output:
-------------
C
CO
COM
COMP
COMPU
COMPUT
COMPUTE
COMPUTER

No comments:

Post a Comment