C 练习实例54
题目:取一个整数 a 从右端开始的 4~7 位。
程序分析:可以这样考虑:文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili54.html
- 先使 a 右移 4 位。
- 设置一个低 4 位全为 1,其余全为 0 的数,可用
(0<<4) - 将上面二者进行 & 运算。
实例
以上实例输出结果为:文章源自公式库网-https://www.gongshiku.com/html/202112/c-lianxishili54.html
运营不易,
感谢支持!

我的微信
我的微信公众号
我的微信公众号扫一扫

我的公众号