Character and ASCII.pdf - Character Variables A character is any one of the following 1 A letter of the alphabet These can be lowercase letters(a b c d

Character and ASCII.pdf - Character Variables A character...

This preview shows page 1 - 4 out of 10 pages.

1 Character Variables A characteris any one of the following: 1. A letter of the alphabet. These can be lowercase letters (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s. t, u, v, w, x, y, z) or uppercase letters (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z). Note that a lowercase character is considered different from its uppercase counterpart, so ‘a’ is different from ‘A’. 2. A digit (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) 3. A special symbol such as +, *, =, <, $, @, etc. Generally, a character is any symbol that can be obtained by pressing a key on the keyboard. In terms of storage requirements, a byte(or 8 bits) is the amount of storage (primary memory or secondary storage) which is needed to store onecharacter. For example, 19 characters (which are stored in 19 bytes) are required to store the following sentence, Hello, how are you? Note that blanks (spaces) and punctuation symbols are included in the count since they are all valid characters. ASCII ASCII stands for American Standard Code for Information Interchange. In ASCII, each character is represented using a specific bit pattern comprising 7 bits. For example, ‘A’ is represented by the following bit pattern: 7 6 5 4 3 2 1 0 0 1 0 0 0 0 0 1 Each bit pattern evaluates to an integer value between 0 and 127. For example, the bit pattern for ‘A’ evaluates to 65. Ninety-five of the encoded characters in ASCII are printable (32-126).
Background image
2 The ASCII character table below shows the characters that are assigned to the integer values between 0 and 127. Most of the characters between 0 and 31 are omitted because they are not useful in modern computing platforms. DECIMAL CHARACTER DECIMAL CHARACTER DECIMAL CHARACTER DECIMAL CHARACTER 0 NUL (null) 32 SPACE 64 @ 96 ` 1 33 ! 65 A 97 a 2 34 " 66 B 98 b 3 35 # 67 C 99 c 4 36 $ 68 D 100 d 5 37 % 69 E 101 e 6 38 & 70 F 102 f 7 BEL (bell) 39 71 G 103 g 8 BS (backspace) 40 ( 72 H 104 h 9 TAB (horizontal tab) 41 ) 73 I 105 i 10 42 * 74 J 106 j 11 43 + 75 K 107 k 12 44 , 76 L 108 l 13 CR (carriage return) 45 - 77 M 109 n 14 46 . 78 N 110 m 15 47 / 79 O 111 o 16 48 0 80 P 112 p 17 49 1 81 Q 113 q 18 50 2 82 R 114 r 19 51 3 83 S 115 s 20 52 4 84 T 116 t 21 53 5 85 U 117 u 22 54 6 86 V 118 v 23 55 7 87 W 119 w 24 56 8 88 X 120 x 25 57 9 89 Y 121 y 26 58 : 90 Z 122 z 27 59 ; 91 [ 123 { 28 60 < 92 \ 124 | 29 61 = 93 ] 125 } 30 62 > 94 ^ 126 ~ 31 63 ? 95 _ 127 DEL ASCII Character Table
Background image
3 Observe that: The character '0' (zero) has the integer value 48. The character '9' has the integer value 57.
Background image
Image of page 4

You've reached the end of your free preview.

Want to read all 10 pages?

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes