'14) write a program to print the following
'1)
'*
'* *
'* * *
'* * * *
n=5
For i=1 To n Step 1
For j=1 To i Step 1
WScript.StdOut.Write "* "
Next
WScript.StdOut.WriteLine ""
Next
'2)
' *
' * *
' * * *
'* * * *
n=5
For i=1 To n Step 1
For j=1 To n-i Step 1
WScript.StdOut.Write " "
Next
For j=1 To i Step 1
WScript.StdOut.Write "* "
Next
WScript.StdOut.WriteLine ""
Next
'3)
' *
' * *
' * * *
' * * * *
n=5
For i=1 To n Step 1
For k=n To i Step -1
WScript.StdOut.Write " "
Next
For j=1 To i Step 1
WScript.StdOut.Write "*" & " "
Next
WScript.StdOut.WriteLine ""
Next
'1)
'*
'* *
'* * *
'* * * *
n=5
For i=1 To n Step 1
For j=1 To i Step 1
WScript.StdOut.Write "* "
Next
WScript.StdOut.WriteLine ""
Next
'2)
' *
' * *
' * * *
'* * * *
n=5
For i=1 To n Step 1
For j=1 To n-i Step 1
WScript.StdOut.Write " "
Next
For j=1 To i Step 1
WScript.StdOut.Write "* "
Next
WScript.StdOut.WriteLine ""
Next
'3)
' *
' * *
' * * *
' * * * *
n=5
For i=1 To n Step 1
For k=n To i Step -1
WScript.StdOut.Write " "
Next
For j=1 To i Step 1
WScript.StdOut.Write "*" & " "
Next
WScript.StdOut.WriteLine ""
Next
Pretty useful!!
ReplyDeletewhere can run this script to see the result?
ReplyDeleteusing notepad(fileName.vbs) it is not printing anything.