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


Please Help Members By Posting Answers For Below Questions

what is diff between static and dynaic arrys?

1560


How do i automate a website www.flyashx.com without having any test cases witin a week time.

1429


Develop a parameterized action that accomplishes the following a. Launch a browser of users choice ( example : IE, chrome etc) b. Open up a search engine (Google, Bing etc) c. Perform a search d. Click a particular link depending on the user’s choice ( 1st , 2nd or third link)

1394


Why is it recommended to close the database connection every time after the work is completed?

476


How to delete a cookie using vbscript?

529






Explain the extension .hta?

518


How to make professional test report using vbscript code in UFT, which gives us complete analysis of the test.

2474


please can you help me to get a code of flames using a visual basic 6

1205


What methods are used to create text files and open text files in the vbscript language?

508


How to throw an error in vbscript?

585


Which operator is used to perform the comparison among 2 operands in the vbscript language?

506


How are values assigned to string type and numeric type variables?

518


How can the spaces from the string be removed?

558


Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.

1504


Set srchobj=Description.Create() srchobj("type").value="text" srchobj("name").value="q" srchobj("html tag").value="input" browser("micclass:=google").Page("micclass:=google").webedit (srchobj).Set "qtp" what's wrong in my code pls tell me ? the above code working fine and i got my result pass,now i am trying to run the program it shows general run time error why?pls help me i am in learning stage ?

1524