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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Which constant is used for print and display functions and works as same as pressing enter key?

532


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

2034


Mention what is the difference between vbscript and vba?

524


How to capture a runtime error in vbscript?

630


where can i learn VB scripint ?

1601






What is the purpose of drive object of scripting.filesystemobject class in vbscript?

610


Which function is used to perform string comparison?

568


Which conditional statement is the most convenient one to use in the case of multiple conditions in the vbscript language?

526


Explain the constants in vbscript?

568


Write a code to print numbers from 5 to 0?

677


write a program to display configuration of a local system with the help of vb script.

1691


how to comvert 120 into one hunderd twenty rupees only and vice varsa

1807


Explain about tristate constants?

587


How to take whole text output from screen of Bitmap Application.

1873


Mention characteristics of sub procedures?

582