when i use + operator in vbscript it not add two variable it works like string formate i.e dim a , b,c a=40,b=30 c=a+b result=4030 while desire result should be 70
I guess it's JavaScript and not VBScript, in VBScript the concatenation operator is & If it's JavaScript, here's the solution! Code: var a=40 var b=30; c=parseInt(a)+parseInt(b); And similar code for VBScript Code: Dim a=40,b=30 c=CInt(a)+CInt(b)
HTML: dim a , b,c a=40,b=30 c=a+b result=4030 while desire result should be 70 thats weird....manojkumarmaithil ... because The Host should interpret your variables to be variant... it means that base from your code the result should be 70... But it seems to me that theres just something wrong in your code... please refer to line number 2 of your code... You cant do a comma when assigning values... try this one instead... ------------------ dim a , b,c a=40 b=30 c=a+b msgbox c, "Result is" --------------------