C 练习实例53

C 语言教程 · 2019-02-22 07:12:49

题目:学习使用按位异或 ^。

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

程序源代码:

//  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 的值为 60 
b 的值为 59 

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

查看所有标签

Foundation Web Standards

Foundation Web Standards

Jonathan Lane、Steve Smith / Friends of ED / 21st July 2008 / $34.99

Foundation Web Standards explores the process of constructing a web site from start to finish. There is more to the process than just knowing HTML! Designers and developers must follow a proper proces......一起来看看 《Foundation Web Standards》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

MD5 加密
MD5 加密

MD5 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换