Problem 44814. Find the complement of a number in binary

Input x is a decimal number and output y is the complement of binary representation of x.

For example, x = 10 has the binary representation of 00001010 (Assume, 8-bit binary representation).

[0   0   0   0   1   0   1   0]

And the output is

y = [1   1   1   1   0   1   0   1]

Solution Stats

35.77% Correct | 64.23% Incorrect
Last Solution submitted on Sep 03, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers42

Suggested Problems

More from this Author1

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!