Sunday, September 4, 2016

// // Leave a Comment

C Program To Print The Integer Value Of A Character

Question: Write a C program that prints the integer equivalents of some uppercase letters, lowercase letters, digits and special symbols. As a minimum, determine the integer equivalents of the following: A B C a b c 0 1 2 $ * + / and the blank character.
/* 
 * Author: AGHATISE OSAZUWA
 * Website: www.cscprogrammingtutorials.com 
 *
 * program that prints the integer equivalents of some uppercase letters,
 * lowercase letters, digits and special symbols.
 */

#include <stdio.h>
int main ( ){ 
    printf("A = %d\n", 'A');
    printf("B = %d\n", 'B');
    printf("C = %d\n", 'C');
    printf("D = %d\n", 'D');
    printf("E = %d\n", 'E');
    printf("a = %d\n", 'a');
    printf("b = %d\n", 'b');
    printf("c = %d\n", 'c');
    printf("d = %d\n", 'd');
    printf("e = %d\n", 'e');
    printf("0 = %d\n", '0');
    printf("1 = %d\n", '1');
    printf("2 = %d\n", '2');
    printf("3 = %d\n", '3');
    printf("4 = %d\n", '4');
    printf("5 = %d\n", '5');
    printf("# = %d\n", '#');
    printf("$ = %d\n", '$');
    printf("@ = %d\n", '@');
    printf("& = %d\n", '&');
    printf("! = %d\n", '!');
    printf("* = %d\n", '*');
    printf("+ = %d\n", '+');
    printf("/ = %d\n", '/');
    printf("- = %d\n", '-');
    printf("Blank character = %d\n", ' ');
    return 0;
}
Click here to see other solutions to Deitel C How To Program exercises.

0 comments:

Post a Comment


DISCLAIMER: Opinions expressed in comments are those of the comment writers alone and does not reflect or represent the views of the post author. We reserve the right to delete any post deemed inappropriate or offensive and/or spammy. Please do not use abusive words/hate speech.

I Appreciate your valuable Feedback. So, Please DO NOT SPAM - Spam comments will be deleted immediately.

Don't use brand name in name field and you're not allowed to use links in comments unless it's necessary. Such comments will be removed immediately.

Thanks.