Console算法[运算符]学习使用按位取反~

ylbtech-Arithmetic:Console-算法[运算符]-学习使用按位取反~
 
1.A,Demo(案例)

 【程序55】
题目:学习使用按位取反~。   
1.程序分析:~0=1; ~1=0;

1.B,Solution(解决方案)
using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            int a, b;
            a = 224;
            b = ~a;
            Console.WriteLine("The a's 1 complement(decimal) is {0}",b);
            a = ~a;
            Console.WriteLine("The a's 1 complement(hexidecimal) is {0}",a);
        }
    }
}
1.C,Execution Result(运行结果)
The a's 1 complement(decimal) is -225
The a's 1 complement(hexidecimal) is -225
请按任意键继续. . .
warn 作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
原文地址:https://www.cnblogs.com/ylbtech/p/3064722.html