home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc_prog / chap03 / chars.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-04-06  |  335 b   |  12 lines

  1. /* chars.c -- shows some variables of type char */
  2. /*            as both characters and integers   */
  3.  
  4. main()
  5. {
  6.     char ch1 = 'A', ch2 = 'a';
  7.  
  8.     printf("The character %c has ASCII code %d\n", ch1, ch1);
  9.     printf("If you add ten, you get %c\n", ch1 + 10);
  10.     printf("The character %c has ASCII code %d\n", ch2, ch2);
  11. }
  12.