Write a function which returns the addition of two numbers.
give the value of the numbers outside the function.

Answers were Sorted based on User's Feedback



Write a function which returns the addition of two numbers. give the value of the numbers outside t..

Answer / sandeepguttikonda

PLEASE REFER THIS ANSWER.
Sorry Missed few Lines in the above posted answer. Please
refer this.

1) Write the below code in notepad and save it as .vbs file.

Function Code:
Public Function Addition_Of_Two_Numbers (Value1,Value2)

Result = Value1 + value2
Addition_Of_Two_Numbers = Result
End Function

2) Open Quick Test Professional Functional Testing Tool

3) Go to File-> Settings-> Resources-> Click '+' symbol
under Associated Function Libraries: and upload the abouve
saved file.

4) Go to Expert View.

5) Write this VBScript Code:
Sum_Of_Two_Numbers = Addition_OF_Two_Number(3,4)
Msgbox "The Addition Of Two Numbers
= "&Sum_Of_Two_Numbers

6) Save this Action and run(F5) it.

This will display the answer 7 in a messagebox.

Note: You can change the constants 3,4 as you required.
Example: if we want to know the sum of 13 and 1 we
will get the answer as 14.

Please let me know if you need any further info.

Thanks.

Regards,
Sandeep Guttikonda

Is This Answer Correct ?    16 Yes 4 No

Write a function which returns the addition of two numbers. give the value of the numbers outside t..

Answer / sandeep guttikonda

1) Write the below code in notepad and save it as .vbs file.

Function Code:
Public Function Addition_Of_Two_Numbers (Value1,Value2)

Result = Value1 + value2
Addition_Of_Two_Numbers = Result
End Function

2) Open Quick Test Professional Functional Testing Tool

3) Go to File-> Settings-> Resources-> Click '+' symbol
under Associated Function Libraries: and upload the abouve
saved file.

4) Go to Expert View.

5) Write this VBScript Code:
Sum_Of_Two_Numbers = Addition_OF_Two_Number(3,4)
Msgbox "The Addition Of Two Numbers
= "&Sum_Of_Two_Numbers

This will display the answer 7 in a messagebox.

Note: You can change the constants 3,4 as you required.

Please let me know if you need any further info.

Thanks.

Regards,
Sandeep Guttikonda

Is This Answer Correct ?    12 Yes 4 No

Write a function which returns the addition of two numbers. give the value of the numbers outside t..

Answer / kshama

Thanks a lot Sandeep.........
its really helpful..

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More QTP Interview Questions

can any one say that where we can download the QTP trail version ??????????

0 Answers  


How to test login page by using QTP

6 Answers  


w is recovery senario manager

3 Answers   Infosys,


HOW TO CONVERT MANUAL TEST CASES IN TO AUTOMATION TEST SCRIPTS EXPLAIN THE PROCESS?

0 Answers   ADP,


Hi... Can anybody help me to write the vbscript for this question..!!! Am having a string "HELLO WORLD", i want to find how many "L"s are there.....????? --> HANEEF <--

5 Answers  






Can anybody give the script to addsheet, add column,add values under that column in the rows?

2 Answers   McAfee,


how do you do database testing in qtp

5 Answers   NIIT,


what is object and child object.. explain ..if possible give some example for better understanding ..

0 Answers   HCL,


What do you to script when objects are removed from application?

0 Answers  


I have to pass all the test cases into gmail userid and password using functions please give me code thanks have anice and greate day

2 Answers  


What is meant by Repository?

7 Answers   ALFiNE IT Solutions, Four soft,


What is User defined function in QTP

6 Answers   Bank Of America,


Categories