A variation of Ananth's method:
inum = 83
quotient = inum/2
strQuotient = CStr(quotient)
print strQuotient
If instr(1,strQuotient,".") Then
print inum & " is odd"
else
print inum & " is even"
End If
On Tuesday, February 5, 2013 2:20:42 AM UTC-5, Ananth wrote:
> Try this
>
>
> X = 5
>
> Y = x/2
> Case 1
> If instr(1,y,".") > 0 then
> Odd
> End if
> Case 2
> If isdecimal(y) then
> Odd
> End if
>
> Sent from my iPhone
>
> On 05/02/2013, at 4:50 PM, RAJ KAMAL <[email protected] <javascript:>>
> wrote:
>
> You cannot use above code It will give wrong answer... 4/2 = 2 not equal
> to 0... So it wil give odd.. = Wrong approach,
>
>
>
> *Use this*
>
> a= 1st number
> b= 2nd number
>
> If a mod b = 0, then even... Else odd
>
>
>
> *-Thanks & Regards,*
>
> *RAJ KAMAL*
> *
> *
>
>
> --
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]<javascript:>
> To unsubscribe from this group, send email to
> [email protected] <javascript:>
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "QTP - HP Quick Test Professional - Automated Software Testing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.