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
what is the standards used for writing the script in QTP
What are the differences between sub procedures and function procedures?
Which date function is used in the vbscript language to find the difference between the 2 dates?
How to write VB script for login module?
How will you get the natural logarithm of the given number in vbscript?
Explain about tristate constants in vbscript?
Mention if qtp generates vbscript code as we record actions, can't it possible to directly write using vbscript code when qtp does the same thing too?
What is the difference between vb debugger and the script debugger?
What are the naming conventions while declaring a variable in the vbscript language?
Differentiate javascript and vbscript?
How to assign a date value to a variable?
How will you get the exponent of the given number in vbscript?
Which operator can be used to do an xor operation in vbscript?
how to write codings in QTP using vb script. please help me. i am new to QTP. it is easy or very much tough. please tell me
How to Import data from a file (file is on the desktop) to the data table