What does this have to do with servlets?
Anyway, you just switch all the 1's to 0's and the 0's to 1's and then add 1.
Easiest way is to substract your number from all 1's and then add 1.
Ex: 1111 - 0010 = 1101
1101 + 1 = 1110
Matt
Quoting Shivanjali Bhutkar <[EMAIL PROTECTED]>:
> how to find 2's complement of a number say 2: 0010?
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html