How to write a C Program to Print ASCII equivalent of a character until terminated by key is ‘x’ in C Programming Language ?
Solution:
#include<stdio.h>
#include<conio.h>
void main()
{
char ch;
clrscr();
printf("Now Enter the Data. To Stop Press 'x'.\n\n");
while((ch = getch()) != 'x')
printf("The ASCII Value of %c is %d\n", ch, ch);
}
You may also learn these C Program/Code :
C Program To Swap Two Numbers Without Using Third Variable
Learn More :
ASCII
Characters
- C Program Character toupper() Example
- C Program Character Example
- C Program To Print Lines Of A Paragraph Having More Than 15 Characters
- C Program To Copy One Character Array Into Another
- C Program to find the number of unique characters
- Printing ASCII Table with Numbers and corresponding characters
- C Program to Compare Two Character
- Design a C function that shortens a string to 8 characters
- Menu driven program in C which performs the following operations on strings
- File Handling (console to file) in C Program