Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Convert_To_Binary(int n)
- {
- int binaryNumber = 0;
- int remainder, i = 1;
- while (n != 0)
- {
- remainder = n % 2;
- n /= 2;
- binaryNumber += remainder * i;
- i *= 10;
- }
- return binaryNumber;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement