C 练习实例52

C 语言教程 · 2019-02-22 06:58:34

题目:学习使用按位或 |。

程序分析:0|0=0; 0|1=1; 1|0=1; 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("b 的值为 %d \n",b);
    b|=7;
    printf("b 的值为 %d \n",b);
    return 0;
}

以上实例输出结果为:

b 的值为 63 
b 的值为 63  

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

查看所有标签

XML Hacks

XML Hacks

Michael Fitzgerald / O'Reilly Media, Inc. / 2004-07-27 / USD 24.95

Developers and system administrators alike are uncovering the true power of XML, the Extensible Markup Language that enables data to be sent over the Internet from one computer platform to another or ......一起来看看 《XML Hacks》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

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

html转js在线工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具