Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

to find twos compliment with decimal input and output

0 votes
asked Aug 22, 2018 by meghana

1 Answer

0 votes
answered Aug 25, 2018 by yatika

first we have to find 1's complement and then add 1 in it, you will get 2's complement.

1's complement can be find by reversing the number, for eg: 1010110 = 0101001(1's complement) and its 2's complement will be 0101001+1= 0101010( 1+1=10).

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...