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...

what is diff b/n these 2 programs
1) for i=5 to 1 step 2
msgbox "pass"
next
2_) for i=5 to 1 step -2
msgbox "pass"
next

Answer Posted / manisha

In the first one it will not display any result.Because the
condition given is wrong .

In the second one the result is displayed as pass for 3
times.

Condition for ForLoop:-
the limit must be in increament order (OR) if the limit is
decreament order we have to mention "Step -n",where n is
to skip or jump .


In the above example:-
For the 1st - no result
for the 2nd - The result is displayed as pass for 3 times.
because for i=5 to 1 step -2
i=5
i=3(jumped to 5-2=3)
i=1(jumped to 3-2=1)

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which operator can be used to change the value of the operand or change the state of the condition?

1038


what is resorceallocation

2229


How will you release the memory acquired by an array variable in vbscript?

1231


Which in-built functions are used to convert the specified expression in the form of date and string in the vbscript language?

1011


What are the valid scopes of a variable in vbscript?

1102


Which operator can be used to check if two numbers are equal or not in vbscript?

1164


can anyone tell me the procedure of interview held in applabs

2190


Capture the Unique label changes on google home page for I am feeling lucky button and save those label changes to Notepad Note: Using QTP

2356


Explain the arrays in vb script?

1068


How to Import data from a file (file is on the desktop) to the data table

2071


What are the special sub-types in vbscript?

1053


Out of the different type of operators, which are evaluated first and last in the vbscript language?

1005


In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?

2477


Explain about adodb.stream class?

1130


I want to run QTP script on Linux server is it possible to do this by connecting Windows to Linux through VPN/Terminal Server and just run the script on Linux server.

2309