Convert ASCII Values C Program

By | October 20, 2015

C Program To Convert ASCII Values

Learn How To Find and Convert ASCII Values in C Programming into its corresponding Character. We have mentioned How to Print Table or Chart for ASCII Values in C along with ASCII Value conversion.

ASCII stands for American Standard Code For Information Interchange.

Method 1: Find ASCII Value in C Programming for any Character

#include<stdio.h>

int main()
{
    char ch;
    printf("\nEnter Character:\t");
    scanf("%c", &ch);
    printf("\nASCII Value of %c: \t%d", ch, ch);
    printf("\n");
    return 0;
}

Output

C Program To Find ASCII Character and Value

Method 2: Print ASCII Character associated with an ASCII Value in C Language

#include<stdio.h>

int main()
{
    int num;
    printf("\nEnter ASCII Code Number:\t");
    scanf("%d", &num);
    printf("\nASCII Value of %d: \t%c", num, num);
    printf("\n");
    return 0;
}

Output

Find and Convert ASCII Values in C Programming for any Character

Method 3: Print ASCII Table (Chart) in C Code

#include<stdio.h>

int main()
{
    int count;
    for(count = 0; count <= 255; count++)
    {   
        getchar();
        printf(" %d = %c\t", count, count);
    }   
    return 0;
}

Note: Press Enter To Print Next ASCII Character and its corresponding Value.

 

In case you get any Compilation Errors or have any doubts in this C Program To Convert ASCII Values into Characters and vice versa, let us know about it in the Comment Section below.

One thought on “Convert ASCII Values C Program

  1. Sayali Mokashi

    This is really a well explained ascii value conversion c program. Thanks for the informatiom though.

    Reply

Let's Discuss