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 108 views
1 answer 106 views
1 answer 103 views
1 answer 103 views
1 answer 98 views
1 answer 92 views
1 answer 107 views
...