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
By default in vbscript the arguments passed to functions and subroutines are by reference or by value?
How to create a function in vbscript?
How to use QTP Object in .vbs(vbscript file) file Ex: Browser().., wait(), exist() and etc...
Explain the scope of the variables using dim, public, and private keywords respectively.
Explain the adodb.stream class?
how to automatically update the sql server2005 database records when insert in vb6?
How are values assigned to the variables in the vbscript language?
What are events in the vbscript language?
What is the scope of a constant declared using public?
How will you compare two strings in vbscript?
What are the data types supported by vbscript?
what is inner join? what is outer join? what is a constraint? tell me about rdbms? tell me about acid properties?
What is the technology used by vb script?
Which in-built function related to an array joins substrings into one string in the vbscript language?
How will you check that a variable is an array in vbscript?