Home > Back-end >  To explain why ch2 is D?
To explain why ch2 is D?

Time:12-26

# include
Void main ()
{char ch1 and ch2.
Ch1='A' + '5' - '3'.
Ch2='A' + '6' - '3'.
Printf (" % d, % c \ n ", ch1 and ch2);
}

CodePudding user response:

Do the ASCII out and the corresponding phase add and subtract, corresponding to the back, can understand, pay attention to decimal and hexadecimal conversion

CodePudding user response:

Is the cause of formatting output, ch1 % d output, is 67, inside the character map is C, ch2 is % C output, so direct output d

CodePudding user response:

Commonly used characters in the ASCII code is the requirement of memory, in particular, uppercase, lowercase letters and Numbers are continuous, so this a see see

CodePudding user response:

Ch2='A' + '6' - '3'.//='A' position + 3=ABC D

CodePudding user response:

The % c is output letters?
  • Related