MOD operator..

Results 1 to 2 of 2

Thread: MOD operator..

  1. #1
    Join Date
    Dec 1969

    Default MOD operator..

    I want to test a variable to see if it is odd or even. so I thought if i take the variable and divide by 2, if it has a remainder then it is odd. I believe the MOD operator is the way to do this, but i do not know the syntax...and need help. <BR><BR>thanks<BR>Brian

  2. #2
    Join Date
    Dec 1969

    Default RE: MOD operator..

    something like:<BR><BR>IF x MOD 2 = 0 THEN<BR>response.write "It&#039;s Even"<BR>ELSE<BR>response.write "It&#039;s Odd"<BR>END IF<BR><BR>assuming x is your variable

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts