Declaring specific numbers | Sololearn: Learn to code for FREE!

+3

Declaring specific numbers

How do you make a digit to show specific function. For example the first digit indicates whether you are male(1) ow female(2) and second digit shows whether you are black(>2)or colored(<=2)

5/10/2021 3:41:48 PM

Themba Samson Phungwayo

1 Answer

New Answer

+2

What you just said is also known as bitset in which we use each bit to represent some binary data and then set that bit if it true Like for male we can turn first bit on and for female we can off that bit Similarly we can do this for color So i recommend to study bitset