Bitwise Challenge Solution


#1
int main(int argc, const char * argv[])
{
   
    // Turn the first bit on
    uint64_t a = 1;
    
    // This is used to add the values
    uint64_t g = 0;
    
    for(int i = 1; i < 64; i+=2) {
        
        g = g + a;
        a = a << 2;
        
         }
    
    printf("Every other bit turned on in a 64 bit integer equals: %llu\n", g);
     return 0;
}