Bit manipulation, uppercase letters to lowercase letters, lowercase letters to uppercase

Source: Internet
Author: User

--------------------------------------------------------------------------------------------------------------- --------------------------------------------------

#include <stdio.h>void main () {//Do not know who found, uppercase and lowercase letters on bits only one bit//capital Letter bits 6th bit is 0//lowercase letter bits 6th bit for 1//bit or action, uppercase to lowercase// Or the operation can change the specified bits to 1int n;__asm mov n,00100000b//VC cannot directly represent the binary, so it has to be converted. for (char c= ' A '; c<= ' Z '; C + +) {//| bitwise OR operator. printf ("%c", c|n);//c or 00100000   //n=32}printf ("or action, uppercase to lowercase \ n");//bitwise AND operation, lowercase to uppercase//with operation can change the specified bits to 0__ASM mov n, 11011111B//VC cannot directly represent the binary, so it has to be converted. for (Char x= ' a '; x<= ' z '; x + +) {//| bitwise OR operator. printf ("%c", x&n),//c or 11011111  //n=223}printf ("with operation, lowercase to uppercase \ n \ nthe");p rintf ("turns a certain bits into 1, with or operation.) \ n ");p rintf (" turn a bits into 0, use and manipulate. \ n ");}


Bit manipulation, uppercase letters to lowercase letters, lowercase letters to uppercase

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.