hi,
i was adding the two numbers in qtp scripts but i didn't get
the answer. see my below script, i dont know wht is the problem.
i passed the value a=3 b= 2, i got the ans 32 instead of 5.
i thing the problem is to be c = a+b
my mail id karthis4u@gmail.com
Dim a, b, c
a = inputbox("enter the a ")
b = inputbox("enter the b ")
c = a + b
print c
Answers were Sorted based on User's Feedback
Answer / deepak singh
hi
Use CINT Function:: correct code is
Dim a, b, c
a =cint( inputbox("enter the a "))
b =cint( inputbox("enter the b "))
c = a + b
msgbox c
send mail if you have any query:
ccna_deepak@yahoo.com
| Is This Answer Correct ? | 21 Yes | 2 No |
Answer / rayudu
a= inputbox("Enter the value a")
b=inputbox("Enter the value b")
c=int(a)+int(b)
msgbox c
| Is This Answer Correct ? | 15 Yes | 0 No |
Answer / qa
hi
Use CINT Function:: correct code is
Dim a, b, c
a =cint( inputbox("enter the a "))
b =cint( inputbox("enter the b "))
c = a + b
msgbox c
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / debee prasad kar
u have to use CINT function which is a conversion
function.If we not use this function then whatever we enter
in inputbox that will be treated as sting.so CINT function
converts from string to integer.
Code:
dim a,b,c
a= cint(inputbox("enter the first number"))
b= cint(inputbox("enter the second number"))
c=cint(a+b)
msgbox c
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / prasad v
hello
which ever the code you have written will be doing
cancatenation by accepting as characters.
if you provide inputs as a="abc" and b="xyz" then output
will be "abcxyz" right.
if you add two numbers you can go for this below code
function sum(a,b)
c=a+b
msgbox c
end function
calling the function
sum 2,3 then you will get output as 5
| Is This Answer Correct ? | 5 Yes | 6 No |
Answer / kavi
Hi,
prasad's code was right.. but we should pass values for the
function sum
dim a,b,c
function sum(a,b)
c=a+b
msgbox c
end function
x=sum(3,2)
| Is This Answer Correct ? | 2 Yes | 4 No |
Answer / ram
Dim a, b, c
a = inputbox("enter the a ")
b = inputbox("enter the b ")
c = a + b
msgbox(&c)
| Is This Answer Correct ? | 1 Yes | 7 No |
How do you learn the object in QTP?
Am going to QTP testing......but i dont know coding languages like (c,c++,java,etc)and am not having interest in coding .............can i choose testing tools like qtp to learn and get a job in software......please reply me
How to create configuration scripts
Tell me the difference between QTP9.2, QTP9.5 and QTP10.0
IN A WEB PAGE THERE IS TWO WEB BUTTON WITH SAME OBJECT PROPERTY AND VALUE, SO HOW I WILL IDENTIFIE OBJECTS INDIVISUALY.
I would like to directly import XL file and work on that XL file directly in QTp script in that XL sheet need to allocate workbench,XL sheet and generate two bar graphs automatically how to do that? plz let me know any answers?
• What type of testing questions will be asked for 2+ yrs exp people in interview?
What is the difference between qtp and selenium?
what is the qtp objects?
How we can import data from database?
I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel how to import all rows of excel sheet to QTP during runtime
What is the difference between Normal mode and Fast mode ?