in , ,

whoIsGonnaTellHim

whoIsGonnaTellHim | programming-memes, program-memes, c++-memes, test-memes, function-memes, search-memes, c-memes, IT-memes, tests-memes | ProgrammerHumor.io
programming-memes, program-memes, c++-memes, test-memes, function-memes, search-memes, c-memes, IT-memes, tests-memes | ProgrammerHumor.io

[text] Why does everyone keep telling me to use c seifprogramminghorror submitted 2 hours ago by ZERIC02005 My task was to create a function in C that would take an integer find the rightmost 0 flip it to a 1 and flip all the 1s to the right of it to 0s. I dont understand why but everyone tells me to just use c instead Strange. uint32t funcuint32t c uint32t i 1 while i 1 searches for the rightmost if c i Tests if the bit is a zero break i1 b if i 10 c 1i Flips the rightmost to a 1 else c If no zeros were found then it was probably hidden in the carry bit flip all 1s to the i 1 Start at the 1 next to the rightmost while i 1 Flip all 1s to the right of it to s C ij io1 b return c Why are people so adamant that I use c instead of C