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

What is vbscript?

0 Answers  


How are comments handled in the vbscript language?

0 Answers  


How can I write HTML text to the window in VB Script?

2 Answers  


Whenever I use Wscript.Echo Qtp raising Run time error as 'Object required for Wscript' How I can create object for Wscript

1 Answers  


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

0 Answers  


Why to add checkpoint in QTP What's the purpose of checkpoints & how to add it

2 Answers  


Could Anybody Please tell me What is the script for Find 3rd Largest element in the Array without using a SORT function int Find(int arr[], int size); Thanks in Advance..

0 Answers   Amazon,


How are values assigned to string type and numeric type variables?

0 Answers  


i need to login to my yahoo accoutnt using VB Script, automating the operation of webobjects, even launching of IE. How?

1 Answers   Mphasis,


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,


write a vb-script code to delete all the mails in my gmail in the year 2011

1 Answers  


What is the differene between QTP 8.2 and QTP 9.0 and QTP 9.1,Pls give me answer ASAP.

3 Answers   Accenture,


Categories