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 argument by reference to a function in vbscript?

0 Answers  


My questions is while writting descriptve programming, lets take flight reservation. Line1: systemutil.Run "D:\Program Files\Mercury Interactive\QuickTestProfessional\samples\flight\app\flight4 a.exe" dialog("text:=Login").WinEdit("attached text:=Agent Name:").Set "mercury" dialog("text:=Login").WinEdit("attached text:=Password:").Set "mercury" dialog("text:=Login").WinButton("text:=OK").click window("text:=Flight Reservation").Activate window("text:=Flight Reservation").ActiveX ("acx_name:=MaskEdBox").Type "111111" window("text:=Flight Reservation").WinComboBox("attached text:=Fly From:").Select "Frankfurt" window("text:=Flight Reservation").WinComboBox("attached text:=Fly To:").Select "London" window("text:=Flight Reservation").WinButton ("text:=FLIGHT").Click window("text:=Flight Reservation").dialog("text:=Flights Table").WinList("text:=From").Select "13536 FRA 08.00AM LON 08.45AM SR $163.00" window("text:=Flight Reservation").dialog("text:=Flights Table").WinButton("text:=OK").Click window("text:=Flight Reservation").WinEdit("attached text:=Name:").Exist window("text:=Flight Reservation").WinEdit("attached text:=Name:").Set "sagar", Now i m getting the error in the last line. it is not accepting the WinEdit("attached text:=Name:") Please do solve this urgent...! and i want to know how to insert additional properties for an object and which properties we need to select from the object spy.

3 Answers  


What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?

0 Answers  


when we use filter funtiom invb script(QTP)

0 Answers   TCS,


How will you convert a string to upper case string using vbscript?

0 Answers  






What is Procedure or Subroutine in VB Script?

0 Answers  


Which object provide information about a single runtime error in a vbscript?

0 Answers  


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.

0 Answers  


write a qtp script to count the number of minimized windows

1 Answers  


How to Import data from a file (file is on the desktop) to the data table

0 Answers   IBM,


We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?

0 Answers  


Capture the Unique label changes on google home page for I am feeling lucky button and save those label changes to Notepad Note: Using QTP

0 Answers   Quest,


Categories