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 |
What is the difference between function and procedure?
Hi, Anybody could tell me What is the script for Reverse of Given number. Ex:236--632. Thanks in Advance..
How to get path of the file through scripting?
where can i learn VB scripint ?
what is the differance between BYVAL,BYREF?
Mention what is vbscript?
this q asked in applabs, q is: QTP should open google.com page and enter "qtp" in one edit(search) box and click search and should open google.com again and enter "job" in edit(search) box and click on search. I tried this but getting error "Edit(search) box matches more than one object", could anyone this question plz..
How will you convert a string to lower case string using vbscript?
Write a Program to add 2 numbers without using operators (+,-) and without using third variable. Note: Use VBScript only Hint: You can use other operators like '/' & '*'(Division & Multiplication)
Difference between Do while loop and while wend loop
HI how can handle dynamic image through vb script example we have to create email id fill the edit box(these latters change wrong password) i am wating your answer
Write a Fucntion to close all Opened browser expect desired one?