Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

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

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

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

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

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

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

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

Post New Answer

More VB Script Interview Questions

What is the difference between VBScript and JavaScript?

0 Answers  


How do you get the value of a combo box in Javascript?

2 Answers   Aspire,


Is VB Script Case sensitive or Case insensitive?

0 Answers  


pls tell me which is good book or site for vbscript?

1 Answers   Mind Tree,


what is the difference between modular and data and keyword driven framework

0 Answers  


What methods are used to create text files and open text files in the vbscript language?

0 Answers  


Which object is used to work with the excel sheets in the vbscript language and what statement is used to create this object?

0 Answers  


Is VBscript case-sensitive?

3 Answers  


Explain about filter expression?

0 Answers  


Hi Friends my Question is very simple,in Manual testing when we click on a hyper link it directs us to the relavent page or it re-directs us to the current page,so there we can easily write testcase but same thing if we do in automation script using QTP & need to generate report using Reporter.report event how we will do it?thanks in advance...

0 Answers  


How to create a cookie using vbscript?

0 Answers  


When importing an excel file that has several columns each with different number of rows into QTP's Global datatable, how can you count the number of rows in a particular column?

3 Answers   Logica CMG, McGraw Hill,


Categories