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

how to write function to validate the number of characters entering into the text box?

2 Answers   TCS,


hai all.iam chandu..please let me know how to test a link in QTP when it is changing at run time..and what property we should take while we r using descriptive programming for a link..

6 Answers  


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

0 Answers  


what is inner join? what is outer join? what is a constraint? tell me about rdbms? tell me about acid properties?

0 Answers   Estuate,


Which in-built function is used to format the number in the vbscript language?

0 Answers  






What is the difference between ByRef and ByVal. When to use ByRef and ByVal

5 Answers   Polaris, TCS,


For a webbased application:- what should be code in expert veiw, for retrieving a single column name "username" from a server and checking whether exported "username" from datatable doesn't exist in server. suppose i have saved in excelsheet a username="gayatri" , which is exported, then checked for whether this username "gayatri" exist in server database or not ? if exist then allow to enter new username, which should be again checked for in loop , or else come out of loop and enter a distinct "username". plz let me have this answer in my id gayatrisahooin@hotmail.com

0 Answers  


What is the purpose of regexp object in vbscript?

0 Answers  


What are lbound and ubound in the vbscript language?

0 Answers  


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

0 Answers  


write a program to display the system specifications of client system with the help of vbScript.

0 Answers  


When to use function procedures and what are its characteristics?

0 Answers  


Categories