Hi Guest 1 HomePage 1 Jobs 1 WalkIn 1Articles  

 :) Latest Topic
Introduction to C
History of C Language
C Variables
Variables Types in C
C Identifiers
C Operators
C Comments
ASCII Value C
Constants C
Features of C
Install C Language
Start C Program
Compilation in c
printf() and scanf()
C Data Types
C Keyword
Format Specifier C
Format Specifier part2
Escape Sequence C
Tokens in C
Boolean in C
What are literals?
 


  

 
ASCII Value C
Question Posted on 25 Aug 2020

Home >> Tutorial >> C Language >> ASCII Value C


ASCII Value C
ASCII full form is American Standard Code for Information Interchange. It is a character encoding scheme which is basically used for electronics communication. Here each character or special character is represented by some ASCII code and here each ascii code will occupies 7 bits in memory.
When we say about C programming language a character variable does not contain a character value of itself rather the asciii value of the character variable. ASCII value represents the character variable in numbers, and each character variable is assigned with some number range from 0 to 127. To understand this a example of ascii value of "A" is 65.
ASCII value of "A" is 65 so 65 will be stored in the character variable rather than "A".

Example for ASCII Character Input and Output

ASCII Values C
In above example program will display ascii value of the charcter variable that we have input in the screen. First user will give the character input then values of that value get stored in the "ch" variable. Then after that it will print value of "ch" variable by using %c format specifier and it will display "A" because we have given the charcter input as "A". If we use %d as format specifier then ascii value will be displayed as 65.

Output
Enter a characterA

The ascii value of the ch variable is : 65


Example for ASCII Character from 0-255 value of all characters


ASCII Values List
In above program this will print ascii value of all characters from 0 to 255 through the for loop.


Example for ASCII Character for Given input


ASCII Input Values
In above code we will take input from user and then convert all character from input to ASCII values. And this will also provide the sum of all character of string in "sum" variable.





Other Important Questions
Features of C
Introduction to C
History of C Language
Install C Language
C Variables







 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |