The article is written in
ISO C90

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | /* Find the greatest power of two that is a divisor of a signed integer in two's-complement form */ #include <stdio.h> int grtwo(int x) { /* assuming two's-complement implementation of int */ return x & -x; } int main(void) { printf("The greatest power of 2 that is a divisor of 100 is %d\n", grtwo(100)); return 0; } |

Category: c

*This article was last modified: Sept. 14, 2016, 4:29 a.m.*

wikicoding is a free and open source project under the GPLv3 license.You can find the source code and contribute to the project via github - wikicoding

Every code has a silver lining.