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 ENVIRONMENT VARIABLES?and where it is used in real time scenario?

2 Answers  


Explain the filter expression?

0 Answers  


We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?

0 Answers  


how to display all the links in one page using vb script in qtp.

1 Answers   DST Global Solutions,


how to add the shared repository file to the script file while running the script manuall

2 Answers  






What is sql loader? Explain the files used by sql loader to load file?

0 Answers  


Which loop is used in case of arrays in the vbscript language?

0 Answers  


int a=4857 i need output as 7584.without using any inbuild function?

6 Answers   Aspire,


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

0 Answers  


What is vbscript procedures?

0 Answers  


What is difference between vbscript and vba?

0 Answers  


What are subprocedures in vbscript?

0 Answers  


Categories