هذا السؤال صعب شوي
ساعدوني بليز :(
في سي ++
Input an integer containing only 0s &1s (i.e., a "binary" integer) & print its decimal equivalent. Use the modulus & division operators to pick off the "binary" number’s digits one at a time from right to left . Much like in the decimal number system , where the rightmost digit has a positional value of 1 , the next digit left has a positional value of 10,then 100, then1000,and so on in the binary number system , the rightmost digit has a positional value of 1, the next digit left has a positional value of2 ,then4,then8,and so on . Thus the decimal number 234 can be interpreted as 4*1+3*10+2*100. Then decimal equivalent of binary 1101 is 1*1+0*2+1*4+1*8 or 1+0+4+8, or 13
يالله ابي مساعدة بسرعة :(