Write a program to display the numbers in the below format using for loops?
1 2 3 4
5 6 7 8
9 10 11 12
and
Write a program to display the numbers in the below format using for loops.
1
2 3
4 5 6
7 8 9 10
Answer Posted / prathyusha
num=0
For i=1 To 4
For j=1 To i
num=num+1
val=val&num
Next
res=res&vbCrLf&val
val=""
Next
MsgBox res
o/p
******
1
23
456
78910
************************
num=0
For i=1 To 3
For j=1 To 4
num=num+1
val=val&num
Next
res=res&vbCrLf&val
val=""
Next
MsgBox res
o/p
*******
1234
5678
9101112
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Which command is used for writing text on a page?
Difference between dim,public and private variables in vb script?
Mention the rules for using option explicit statement?
What are the 2 ways to pass a value to the function?
Which operator can be used to do an xor operation in vbscript?
Mention what is the use of option explicit in vbscript?
Both Static and dynamic arrays are handled by VB script. Is it true?
Can anyone send me a vb script function for verifying the functionality of active links on a web page
filter the array values without using filter function?
What is Procedure or Subroutine in VB Script?
What is the difference between vbscript and vba?
Why is error handling required?
How to replace junk code recorded by QTP with a mall function.
What are class events?
How will you get the largest subscript of an array in vbscript?