write a vb script to display first 5 odd numbers from 1 to 100

Answer Posted / mudaseer

dim i,vcnt,vstro
vcnt=0
for i=1 to 100 step 2
vstro=vstro & i & vbnewline
vcnt=vcnt+1
if vcnt=5 then exit for
next
msgbox vstro

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the tristate constants in vbscript?

563


Illustrate briefly about the different types of statement

2027


Mention what is select case statement?

548


Hi Friends Rajendra this is bhavani prasad, iam working Hyderabad. i faced one problem with qtp recording mode i.e in my application there is 100 records first we click the first record that record will be jumped to next session and 99 records will there stop the recording and run the same script .Run this script qtp does not identify the records. So plz tell me what is the solution.

1574


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

2264






What is the use of the date function in the vbscript language?

569


How to create a function in vbscript?

590


What is dictionary object in vbscript? Explain?

628


How will you get the natural logarithm of the given number in vbscript?

607


Explain about scrrun.dll in vbscript?

654


Which operator can be used to change the value of the operand or change the state of the condition?

581


Mention how to access array data?

515


Which date function is used in the vbscript language to find the difference between the 2 dates?

595


What aspects of vbscript make it safe so that a web page using vbscript cannot destroy or corrupt information on a user's computer?

583


Which command is used for writing text on a page?

578