C Program to Print ASCII equivalent of a character until terminated by key is ‘x’

How to write a C Program to Print ASCII equivalent of a character until terminated by key is ‘x’ in C Programming Language ?

Solution:

/* C Program to Print ASCII equivalent of a character until terminated by key is ‘x’*/

#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 :