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 purpose of drive object of scripting.filesystemobject class in vbscript?
How will you format a number in percetage format in vbscript?
Explain about the extension .hta?
What are the differences between sub procedures and function procedures?
create a form to accept username and password validate the username and password with using message box, display the corresponding user message
how to check whether link is disabled in QTP??
If else for do while select in vb script?
Which keyword is used to declare a variable in the vbscript language?
Explain How do you create a recordset object in vbscript?
Which data type/types are supported by vbscript language and what are their specialties?
Mention how to create a cookie using vbscript?
What is purpose of scripting.filesystemobject class in vbscript?
Which function allows you to instantiate an object given its programmatic identifier or progid?
How to pass argument by reference to a function in vbscript?
if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.