C 练习实例51

C 语言教程 · 2019-02-22 06:43:18

题目:学习使用按位与 &。

程序分析:0&0=0; 0&1=0; 1&0=0; 1&1=1 。

程序源代码:

//  Created by www.codercto.com on 15/11/9.
//  Copyright © 2015年 码农教程. All rights reserved.
//

#include <stdio.h>
int main()
{
    int a,b;
    a=077;
    b=a&3;
    printf("a & b(decimal) 为 %d \n",b);
    b&=7;
    printf("a & b(decimal) 为 %d \n",b);
    return 0;
}

以上实例输出结果为:

a & b(decimal) 为 3 
a & b(decimal) 为 3

点击查看所有 C 语言教程 文章: https://www.codercto.com/courses/l/17.html

查看所有标签

Getting Real

Getting Real

Jason Fried、Heinemeier David Hansson、Matthew Linderman / 37signals / 2009-11-18 / USD 24.99

Getting Real details the business, design, programming, and marketing principles of 37signals. The book is packed with keep-it-simple insights, contrarian points of view, and unconventional approaches......一起来看看 《Getting Real》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

html转js在线工具
html转js在线工具

html转js在线工具