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 are keywords in the vbscript language?
Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.
Explain the arrays in vb script?
Which object provide information about a single runtime error in a vbscript?
write a function to read the items from combobox of Flight reservation & save in excel (QTP)??
Which constant is used for print and display functions and works as same as pressing enter key?
Can anyone send me a vb script function for verifying the functionality of active links on a web page
What is vbscript language used for and which earlier language is it modeled upon?
Explain about tristate constants?
accept a string & display whether a is present or not
Why is the use of exit do or exit for statements within loops discouraged?
Explain vbscript in detail?