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

Answers were Sorted based on User's Feedback



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 / vamsi

Write a program to display the numbers in the below format using for loops.
1
2 3
4 5 6
7 8 9 10

Is This Answer Correct ?    3 Yes 3 No

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 / 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

More VB Script Interview Questions

How to Pass Multiple values in functions by using vb script? Function value(arg1,arg2) N1=arg1+arg2 N2=arg1-agr2 N3=arg1*agr2 N4=arg1/arg2 Value= How to pass ? End Function

3 Answers   iGate,


Which operator is used to concatenate the 2 values in the vbscript language?

0 Answers  


Which is the default Data types in VBScript?

5 Answers  


How to search word in a string without using instring function?

1 Answers   CSS Corp,


Write a Script for ATM in QTP

0 Answers  






Hi All, I am facing one problem in QTP. There is link object in my application that exist in the Frame in mozilla firefox. Click event on that object is not working but once the frame is enabled/activated then click event works fine.But the frame does not have the activate property. This problem is coming in firefox only. Regards

0 Answers  


How to identify column in VSFlexgrid? My VSFlexgrid window is identified as 'Active X Control'

0 Answers  


Explain about tristate constants in vbscript?

0 Answers  


while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans

0 Answers   IBM,


How will you generate Reports using Vb Script?it asked in testing(QTP)Interview.Plz Any Body Let me know. Thanks uday Uday_testing@yahoo.co.in

4 Answers   NIIT,


Explain the functionality of vbscript?

0 Answers  


Hellow friends, I am learning QTP,but here problem is VB script. please guide me how to learn VB script w.r.t QTP and if you know any books tell me or if you have any materials or any use full material or any else w.r.t QTP please post me p.p.sekhar

0 Answers  


Categories