codescracker


c

C Program to Print ASCII Values of Characters



« Previous Program Next Program »


Print ASCII Value in C

To print ASCII values of all the character in C programming, use the number from 1 to 255 and place their equivalent character with %c format specifier to convert ASCII value into their equivalent characters to show the ASCII values and equivalent characters on the screen.

C Programming Code to Print ASCII Values of Characters

Following C program print ASCII values of all the characters:

/* C Program - Print ASCII Values of Characters */
		
#include<stdio.h>
#include<conio.h>
void main()
{
	clrscr();
	char ch;
	int i;
	for(i=1; i<255; i++)
	{
		ch=i;
		printf("%d -> %c\t",i, ch);
	}
	getch();
}

When the above c program is compile and executed, it will produce the following result:

c program print ascii values

Same Program in Other Programming Language

You may also like same program in other programming languages:


« Previous Program Next Program »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test