How to double a variable with bitwise shift left in C

1 Answer

0 votes
#include <stdio.h>

int main() {
    int num = 8;
    
    num = num << 1; 

    printf("%d\n", num);

    return 0;
}


/*
run:

16

*/

 



answered Mar 8, 2025 by avibootz

Related questions

1 answer 186 views
1 answer 198 views
1 answer 188 views
1 answer 197 views
1 answer 183 views
1 answer 202 views
1 answer 194 views
...