Kaskus

Tech

vieoldiaorstabAvatar border
TS
vieoldiaorstab
c++ : tolongin ane bitwise operator gan...
ane baru belajar c++ gan pke ebook... nah ad soal kaya gini :

Write a program that reads an integer value from the keyboard into a variable of type int , and uses one of the bitwise operators (i.e. not the % operator!) to determine the positive remainder when divided by 8. For example, 29 = (3x8)+5 and 14 = ( 2x8)+2 have positive remainder 5 and 2, respectively, when divided by 8.

ane dah dpt jawabannya dari hasil ane nyari di google :
Spoiler for code:


nah tapi ane masih bingung. kok bisa tw klo hrus di &7?? masa harus dicoba satu satu angkanya? ato ad caranya biar gampang nemuinnya? ane bingung gan...(maaf klo pertanyaan ane konyol gan, baru belajar bgt) emoticon-Sorry
0
689
1
GuestAvatar border
Komentar yang asik ya
Mari bergabung, dapatkan informasi dan teman baru!
Programmer Forum
Programmer Forum
KASKUS Official
20.2KThread4.9KAnggota
Urutkan
Terlama
GuestAvatar border
Komentar yang asik ya
Ikuti KASKUS di
© 2025 KASKUS, PT Darta Media Indonesia. All rights reserved.