Home  >  Article  >  Backend Development  >  How to represent binary in C language

How to represent binary in C language

藏色散人
藏色散人Original
2020-02-26 09:17:5326033browse

How to represent binary in C language

How to represent C language binary?

1. First, open the C language compiler and create a new initial .cpp file, for example: test.cpp.

How to represent binary in C language

2. In the test.cpp file, enter the C language code: int a = 0b00000000;int a1 = 0b00000001;printf("%d", a^a1) ; .

How to represent binary in C language

#3. The compiler runs the test.cpp file. At this time, the binary number is successfully defined and output after XOR operation.

How to represent binary in C language

For more programming-related content, please pay attention to the Programming Introduction column on the php Chinese website!

The above is the detailed content of How to represent binary in C language. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn