write a vb script to display first 5 odd numbers from 1 to 100
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / eswar
cnt =0
For i=1 to 100
If (i mod 2 <> 0) Then
MsgBox i
cnt=cnt+1
End If
If cnt=5 Then
Exit for
End If
Next
| Is This Answer Correct ? | 7 Yes | 3 No |
Answer / anjali tamrakar
Private sub form_load()
Dim a as integer
Dim b as integer
B=0
For A=1 to 100 step2
B=B+A
Print A,B
Next A
End sub
| Is This Answer Correct ? | 5 Yes | 3 No |
Answer / psri
dim a(50)
j=0
for i = 1 to 100
if (i mod 2) <> 0 then
a(j)=i
j=j+1
cnt=cnt+1
End if
next
msgbox "The odd no is "& join(a) &"The total no of odd no's
is"&cnt
| Is This Answer Correct ? | 2 Yes | 3 No |
filter the array values without using filter function?
How will you trim the spaces on the left of a string using vbscript?
Mention what is variant in vbscript?
Hello Friends , I am the new joinner of this website. I am working with Sapient ,Gurgoan I would like to ask few qurries regarding the QTP Tool of (Testing) Currently working on QTP Tool . I would like to no learn VB Script can u name some Books which i get in market. And a small issue in QTP I had 2 users right i have to login and send the document from this user to second user right. when i am send this doc some contendId number generates right. now i am loging into second user and i have to search for that contentId right i found it now i dont want to accept the document so i had an opption of check out ok i have to click on check out my QTP Code is like this Browser(" ").Page(" ").WebTable(" ").ChildItem (3,5,"Image",0).click Browser(" ").Page(" ").Link("ChecK Out").Click i new this code is perfectly right but when i am run the script i have to click on that particular contentId and click on check out but now the Problem is started the error is the document has been already checked out remeber every time my content id changes means it is the new contentId which is not been used atleast once Please help me out in this issue i am in big trouble
Find Out Length of an array without using Ubound?
how to operate webobjects in a webpage using getobject function and then using generic methods?
HOw we can apply web service checkpoint in QTP 9.5? I tried it out with net connection also. But not getting success.
Hi, Can anyone please send me vb script examples to practice vb and also material to learn vb scripting in QTP? my email id : hareen_11@yahoo.com
Write a program to print all lines that contains a word either “testing” or “qtp”
write a program to display configuration of a local system with the help of vb script.
Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?
Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder