How to get 120 using 5 zeroes, you can use any operator(+,
*, /...) in qtp.

Answers were Sorted based on User's Feedback



How to get 120 using 5 zeroes, you can use any operator(+, *, /...) in qtp...

Answer / sureshkumar

We can get 120 using factorial, i.e

Factorial (0) = 1 so that

(0! + 0! + 0! + 0! + 0!)! = 5! => 120

Is This Answer Correct ?    7 Yes 1 No

How to get 120 using 5 zeroes, you can use any operator(+, *, /...) in qtp...

Answer / testengineer

Option Explicit
Dim temp,Factorial,i,j,k,x
temp=0
Factorial = 1
For i=1 to 5 step 1
x= Inputbox ("Enter a No. :") '(Enter Zero for
Five Times)
For j=x to 1 Step -1
Factorial=Factorial*j
Next
temp = temp+Factorial
Next
For k=temp to 1 Step -1
Factorial=Factorial*k
Next
Msgbox Factorial

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More VB Script Interview Questions

Set srchobj=Description.Create() srchobj("type").value="text" srchobj("name").value="q" srchobj("html tag").value="input" browser("micclass:=google").Page("micclass:=google").webedit (srchobj).Set "qtp" what's wrong in my code pls tell me ? the above code working fine and i got my result pass,now i am trying to run the program it shows general run time error why?pls help me i am in learning stage ?

0 Answers  


if there is any string in a given format like as "company name employeecode date" then we have to fetch employeecode form string for ex-string is "capgemini12345june2013" then we have to fetch 12345 by using vb script so guys how can we do that please reply it.

3 Answers   Cap Gemini,


Explain the tristate constants in vbscript?

0 Answers  


write a vb script to display the reverse of vbs

2 Answers  


How to load vbs functions in qtp

2 Answers  






what is the differance between BYVAL,BYREF?

0 Answers  


Does VB/Win make standalone .EXE files?

0 Answers  


In our application qtp unable to indentify the menu items,we tried number of times to add objetcs into object repository but fail. through normal recording mode only objects going to add into repository but while running same recording script qtp showing a error like " unable to indentify the object". in repository there is no any properties and pro values for that object and also i tried with virtual object config also unable to find the object in application and in repository. Then what i have to do to identify menu objects????? can anybody hell me pls..............

2 Answers   Blue Star,


can any body give the code to write the function for given suppose user login with usrer id and pwd to yahoomail.after cliking "sign in"if it is valid user id the next page will display userid'message box.( Note u have to use excel sheet to retrive the userid's data)

3 Answers   Bally Technologies,


hai..friends ....what is the difference between function and sub procedure ....here every one know's theoretically here my question is what is the meaning of function can return the value and sub can't return the value...can you give one example with some values for that ....what does it mean ? how function can return the value...sub can not...any one please...........with example

1 Answers   Cap Gemini,


How will you get the exponent of the given number in vbscript?

0 Answers  


What are class variables?

0 Answers  


Categories